1、提前安装环境
操作系统:CentOS Linux release 7.2.1511 (Core)
OpenTSDB版本:2.3.0
JDK版本:1.8.1_101
Apache HBase版本:1.2.2
2、安装Gnuplot
Opentsdb还依赖Gnuplot,它是一个命令行的交互式绘图工具,一般使用Linux发行版的源即可安装:
yum install gnuplot
3、安装OpenTSDB,进入OpenTSDB官网:
RPM路径:
https://github.com/OpenTSDB/opentsdb/releases/download/v2.0.1/opentsdb-2.0.1.noarch.rpm
安装命令:
rpm -ivh opentsdb-2.0.1.noarch.rpm
4、 安装完后,重要的目录如下:
/etc/opentsdb - Configuration files /tmp/opentsdb - Temporary cache files /usr/share/opentsdb - Application files /usr/share/opentsdb/bin - The "tsdb" startup script that launches a TSD or commandline tools /usr/share/opentsdb/lib - Java JAR library files /usr/share/opentsdb/plugins - Location for plugin files and dependencies /usr/share/opentsdb/static - Static files for the GUI /usr/share/opentsdb/tools - Scripts and other tools /var/log/opentsdb - Logs
修改配置文件 /usr/share/opentsdb/etc/opentsdb/opentsdb.conf 的 tsd.storage.hbase.zk_quorum值
tsd.storage.hbase.zk_quorum =hadoop107:2181,hadoop104:2181,hadoop108:2181
5、如果是第一次安装,需要先在HBase 中创建相关数据表
cd /usr/share/opentsdb/tools
env COMPRESSION=NONE HBASE_HOME=/usr/hdp/2.6.3.0-235/hbase-/usr/share/opentsdb/tools/create_table.sh
# hbase shell
list
可以查看到新建的四个表tsdb、tsdb-meta、tsdb-tree、tsdb-uid
6、启动服务:
service opentsdb start
7、创建Metrics
cd /usr/share/opentsdb/bin
./tsdb uid assign metrics <metric_name>
原文:https://www.cnblogs.com/pikaqiucode/p/10558190.html