一、设置JDK
配置java环境到/etc/profile中
1 2 3 4 5 | export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATHexport HADOOP_CONF_DIR=/etc/hadoop |
二、安装opentsdb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 安装GnuPlotyum install gnuplot验证gnuplot的安装以及png的安装成功gnuplotgnuplot> set terminal png安装opentsdb配置$ cd /usr/share/opentsdb$ vim /usr/share/opentsdb/etc/opentsdb/opentsdb.conftsd.network.port = 4242tsd.http.staticroot = build/staticroottsd.http.cachedir = /tmp/opentsdbtsd.core.auto_create_metrics = truetsd.storage.hbase.zk_quorum = localhost:2181在Hbase中创建表env COMPRESSION=NONE HBASE_HOME=/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase /usr/share/opentsdb/tools/create_table.sh赋权chown -R 755 /usr/share/opentsdbln -s /usr/share/opentsdb/etc/init.d/opentsdb /etc/init.d/# ln -s /usr/share/opentsdb/etc/systemd/system/opentsdb@.service /etc/systemd/system/ln -s /usr/share/opentsdb/etc/opentsdb/* /etc/opentsdb/ln -s /usr/share/opentsdb/bin/tsdb /usr/bin/ |
三、注册系统服务
opentsdb的服务注册为系统服务,即可以用systemctl status/start/stop/restart opentsdb来查看控制
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | vi /usr/lib/systemd/system/opentsdb.service[Unit]Description=OpenTSDB Service[Service]Type=forkingPrivateTmp=yesExecStart=/usr/share/opentsdb/etc/init.d/opentsdb startExecStop=/usr/share/opentsdb/etc/init.d/opentsdb stopRestart=on-abortln -s /usr/share/opentsdb/etc/opentsdb/* /etc/opentsdb/ |
四、启动
1 | systemctl start opentsdb |