#Opentsdb依赖Gnuplot,它 是一个命令行的交互式绘图工具。用户通过输入命令,可以逐步设置或修改绘图环境,并以图形描述数据或函数,使我们可以借由图形做更进一步的分析
yum install gnuplot
#安装opentsdb
cd /home/opentsdb
./build.sh
#注:build过程可能失败,安装autoconf和automake(yum install autoconf;yum install automake)
#如果报'aclocal-1.14' is missing on your system 则执行 sudo autoreconf -ivf
#配置环境变量,在shell中执行如下命令
env COMPRESSION=NONE HBASE_HOME=/home/hadoop/hadoop-2.6.0
#建表
cd /home/opentsdb/src
vi create_table.sh
create 'tsdb-uid',
{NAME => 'id', COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'},
{NAME => 'name', COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
create 'tsdb',
{NAME => 't', VERSIONS => 1, COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
create 'tsdb-tree',
{NAME => 't', VERSIONS => 1, COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
create 'tsdb-meta',
{NAME => 'name', COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
#运行opentsdb
./build/tsdb tsd --port=4242 --staticroot=build/staticroot --cachedir=/tmp/tsdtm --zkquorum=sms-test-001:2181,sms-test-002:2181,sms-test-003:2181
#启动参数说明
Usage: tsd --port=PORT --staticroot=PATH --cachedir=PATHStarts the TSD, the Time Series Daemon
--async-io=true|false Use async NIO (default true) or traditionalblocking io
--auto-metric Automatically add metrics to tsdb as they are inserted. Warning:this may cause unexpected metrics to be tracked
--cachedir=PATH Directory underwhich to cache result of requests.
--flush-interval=MSEC Maximum time for which a new data point canbe buffered (default: 1000).
--port=NUM TCPport to listen on.
--staticroot=PATH Web root from which toserve static files (/s URLs).
--table=TABLE Nameof the HBase table where to store the time series (default: tsdb).
--uidtable=TABLE Name of theHBase table to use for Unique IDs (default: tsdb-uid).
--worker-threads=NUM Number for async io workers(default: cpu * 2).
--zkbasedir=PATH Path underwhich is the znode for the -ROOT- region (default: /hbase).
--zkquorum=SPEC Specificationof the ZooKeeper quorum to use (default: localhost).
## /home/opentsdb/build下的tsdb运维脚本
#添加指标
./tsdb mkmetric sms.user.submit#删除指标
./tsdb uid delete metrics sms.user.submit
#查看指标
./tsdb uid grep sms.user.submit
9.grafana安装
1.sudo yum install initscripts fontconfig
2.sudo rpm -Uvh grafana-4.0.0-1478693311beta1.x86_64.rpm
配置文件 /etc/grafana/grafana.ini
启动 service grafana-server start
关闭 service grafana-server stop