版本:2.3.0
1.下載介質
我這里下載的是opentsdb-2.3.0.tar.gz
2.安裝依賴包
Opentsdb依賴Gnuplot,它 是一個命令行的交互式繪圖工具。
用戶通過輸入命令,可以逐步設置或修改繪圖環境,並以圖形描述數據或函數,使我們可以借由圖形做更進一步的分析。
yum install gnuplot
2.拷貝到相應目錄並解壓安裝
[root@localhost opt]# tar -xvf opentsdb-2.3.0.tar.gz
進入目錄
cd opentsdb-2.3.0
編譯安裝
./build.sh
cd build
make install
make[1]: *** [.javac-stamp] Error 2
make[1]: Leaving directory `/opt/opentsdb-2.3.0/build'
make: *** [all] Error 2
You have new mail in /var/spool/mail/root
好像這種方式不行
3.換另外一種方式進行
[root@localhost opentsdb-2.3.0]# pwd
/opt/opentsdb-2.3.0
[root@localhost opentsdb-2.3.0]# mkdir build
[root@localhost opentsdb-2.3.0]# cp -r third_party ./build
[root@localhost opentsdb-2.3.0]# ./build.sh
4.配置OpenTSDB
配置文件為:/opt/opentsdb-2.3.0/src/opentsdb.conf
修改的地方如下:
# The TCP port TSD should use for communications
# *** REQUIRED ***
tsd.network.port = 4242
# The location of static files for the HTTP GUI interface.
# *** REQUIRED ***
tsd.http.staticroot =build/staticroot
# Where TSD should write it's cache files to
# *** REQUIRED ***
tsd.http.cachedir = /tmp/tsd
# Whether or not to automatically create UIDs for new metric types, default is False
tsd.core.auto_create_metrics = true
# A comma separated list of Zookeeper hosts to connect to
tsd.storage.hbase.zk_quorum = cdhmanager:2181
# Cover duplicates data
tsd.storage.fix_duplicates = true
tsd.network.port = 4242
tsd.network.bind = 0.0.0.0
tsd.network.worker_threads = 8
tsd.http.staticroot = build/staticroot
tsd.http.cachedir = /tmp/opentsdb
tsd.core.auto_create_metrics = true
tsd.storage.hbase.zk_quorum = localhost:2181
5.創建hbase表
[root@localhost opentsdb-2.3.0]# cd /opt/opentsdb-2.3.0
[root@localhost opentsdb-2.3.0]# env COMPRESSION=NONE HBASE_HOME=/opt/hbase-1.2.1 ./src/create_table.sh
執行完成后會創建4張表,可以進入到hbase里查看
[root@localhost bin]# ./hbase shell
2019-07-24 14:15:42,692 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.1, r8d8a7107dc4ccbf36a92f64675dc60392f85c015, Wed Mar 30 11:19:21 CDT 2016
1.8.7-p357 :001 > list
TABLE
tsdb
tsdb-meta
tsdb-tree
tsdb-uid
4 row(s) in 0.2480 seconds
6.啟動
nohup /opt/opentsdb-2.3.0/build/tsdb tsd --config=/opt/opentsdb-2.3.0/src/opentsdb.conf >/dev/null 2>&1 &
7.登陸訪問
http://192.168.1.118:4242
8.日志管理
Opentsdb日志管理:一般由於opentsdb默認的日志特別多,尤其以nohup啟動的話,日志很有可能占滿整個磁盤。
所以這里需要修改opentsdb的bug級別。
Opentsdb采用slf4j作為日志管理,主要日志配置在/src/logback.xml文件中,主要的日志級別如下:
(1)ERROR主要打印錯誤信息,操作失敗等,這將影響opentsdb的正常使用
(2)WARN這是由於不正確的操作造成的,但不至於影響opentsdb的正常運行
(3)INFO
(4)DEBUG
(5)OFF
日志文件存放在/var/log/opentsdb下