版本:2.3.0
1.下载介质
我这里下载的是opentsdb-2.3.0.tar.gzjava
2.安装依赖包
Opentsdb依赖Gnuplot,它 是一个命令行的交互式绘图工具。
用户经过输入命令,能够逐步设置或修改绘图环境,并以图形描述数据或函数,使咱们能够借由图形作更进一步的分析。
yum install gnuplotshell
2.拷贝到相应目录并解压安装
[root@localhost opt]# tar -xvf opentsdb-2.3.0.tar.gz
进入目录app
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工具
好像这种方式不行oop
3.换另一种方式进行ui
[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.shspa
4.配置OpenTSDB
配置文件为:/opt/opentsdb-2.3.0/src/opentsdb.conf.net
修改的地方以下:
# 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下