您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關opentsdb分布式時間序列數據庫如何安裝,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
簡介:
opentsdb是一個分布式、易擴展的分布式時間序列數據庫。基于HBase做存儲,一方面使其能支持海量的數據,一方面也非常容易擴展。主要用于一些服務的監控,比如性能等等。
官方文檔:
http://opentsdb.net/docs/build/html/installation.html#runtime-requirements
http://opentsdb.net/docs/build/html/user_guide/configuration.html
前期準備:
A Linux system
Java Runtime Environment 1.6 or later
HBase 0.92 or later
GnuPlot 4.2 or later
HBase、ZooKeeper:線上已經安裝好,文章不在講述
安裝過程:
1) 依賴庫安裝:
sudo yum install -y gd gd-devel libpng libpng-devel
2) gnuplot-5.0.1安裝:
下載,解壓,三步走(./configure & make & make install) #不用指定prefix前綴,會安裝到prefix指定目錄下的 /share /bin /libexec下
3)安裝opentsdb,
下載tar或者git clone , ./build.sh #服務器需要能連接外網
編譯日志:
Linking into /home/hadoop/opentsdb/build/gwt/queryui --后面遇到了問題,根據編譯日志解決
Link succeeded
Compilation succeeded -- 30.289s
/bin/mkdir -p staticroot
cp ../src/tsd/static/favicon.ico ../src/tsd/static/opentsdb_header.jpg staticroot
find -L staticroot -type l -exec rm {} \;
p=`pwd`/gwt/queryui && cd staticroot \
&& for i in $p/*; do ln -s -f "$i" || break; done
find -L staticroot/gwt -type f | xargs touch
make64[1]: Leaving directory `/home/hadoop/opentsdb/build'
建表:
env COMPRESSION=NONE HBASE_HOME=/home/hadoop/hbase-1.0.0-cdh6.5.1/ ./src/create_table.sh #根據需要自己判斷是否使用壓縮
修改配置:
OpenTSDB 2.2 works off a configuration file that is shared between the daemon and command line tools. If you compiled from source, copy the ./src/opentsdb.conf file to a proper directory as documented in Configuration and edit the following, required settings: tsd.http.cachedir - Path to write temporary files to tsd.http.staticroot - Path to the static GUI files found in ./build/staticroot tsd.storage.hbase.zk_quorum - If HBase and Zookeeper are not running on the same machine, specify the host and port here. With the config file written, you can start a tsd with the command: You can use the --config command line argument to specify the full path to a configuration file. Otherwise if not specified, OpenTSDB and some of the command-line tools will attempt to search for a valid configuration file in the following locations: ./opentsdb.conf /etc/opentsdb.conf /etc/opentsdb/opentsdb.conf /opt/opentsdb/opentsdb.conf
修改的配置: cp src/opentsdb.conf . #按官方文檔,復制配置文件到opentsdb安裝目錄 tsd.network.port = 8999 #端口修改 # The location of static files for the HTTP GUI interface. # *** REQUIRED *** tsd.http.staticroot = /home/data/opentsdb/static #自己定義的,有問題,看問題2 = /home/hadoop/opentsdb/build/staticroot #正確的 # Where TSD should write it's cache files to # *** REQUIRED *** tsd.http.cachedir = /home/data/opentsdb/cache tsd.storage.hbase.zk_quorum = host1:2181,host:2181,host3:2181
++++++++++++++++++++++++++++++ 遇到的問題和解決辦法 ++++++++++++++++++++++++++
問題1:日志目錄
16:46:33,197 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /var/log/opentsdb/opentsdb.log
16:46:33,197 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/var/log/opentsdb/opentsdb.log]
16:46:33,198 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Failed to create parent directories for [/var/log/opentsdb/opentsdb.log]
16:46:33,199 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/log/opentsdb/opentsdb.log,true) call failed. java.io.FileNotFoundException: /var/log/opentsdb/opentsdb.log (No such file or directory)
修改:src/logback.xml 把日志目錄改成自己定義的
問題2:web界面打不開,日志報找不到文件
2016-07-05 16:48:03,362 INFO [OpenTSDB I/O Worker #1] HttpQuery: [id: 0xd617c536, /xxx:xxx:xx:xx:52403 => /xx:xx:xx:xx:8999] HTTP /s/opentsdb_header.jpg done in 0ms
2016-07-05 16:48:03,810 WARN [OpenTSDB I/O Worker #1] HttpQuery: [id: 0xd617c536, /xx:xx:xx:xx:52403 => /xx:xx:xx:xx:8999] File not found: /home/data/opentsdb/static/favicon.ico (No such file or directory)
查看編譯時的日志:
Linking into /home/hadoop/opentsdb/build/gwt/queryui
Link succeeded
Compilation succeeded -- 30.289s
/bin/mkdir -p staticroot
cp ../src/tsd/static/favicon.ico ../src/tsd/static/opentsdb_header.jpg staticroot
修改配置:
tsd.http.staticroot = /home/hadoop/opentsdb/build/staticroot
關于“opentsdb分布式時間序列數據庫如何安裝”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。