1、介绍
OpenTSDB是一个架构在Hbase系统之上的实时监控信息收集和展示平台。它支持秒级数据采集所有metrics,支持永久存储,可以做容量规划,并很容易的接入到现有的报警系统里。OpenTSDB可以从大规模的集群(包括集群中的网络设备、操作系统、应用程序)中获取相应的metrics并进行存储、索引以及服务,从而使得这些数据更容易让人理解,如web化,图形化等。
2、安装
安装Gnuplot
Gnuplot 是一个命令行的交互式绘图工具(command-driven interactive function plotting program)。用户通过输入命令,可以逐步设置或修改绘图环境,并以图形描述数据或函数,使我们可以借由图形做更进一步的分析。
yum install gnuplot
如果是下载压缩包压缩包的话,解压后进入目录分别执行 ./configure; make; make check; make install
下载压缩包安装过程如下:
# based on a minimal installation, you need some packages in order to compile, I suggest
yum install gcc gcc-c++ make libX11 xauth
yum install cairo-devel pango-devel freetype-devel gd-devel
cd /usr/local/src/
wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.2/gnuplot-4.4.2.tar.gz/download
tar xzf gnuplot-4.4.2.tar.gz
cd gnuplot-4.4.2
less INSTALL
# start compiling. I usually install self-compiled stuff at /opt/[PKG-NAME]
./configure --prefix=/opt/gnuplot442
make
# make sure the shipped version of gnuplot is removed (this is probably not necessary but prevents version mix-up)
yum remove gnuplot
make install
# you might want to add a symlink
ln -s /opt/gnuplot442/bin/gnuplot /usr/bin/gnuplot
安装完成后执行gnuplot,确认支持png :执行set terminal可以查看
如果不支持则opentsdb在画图时会报错
安装完后可以验证是否可以正常画出png图片,画png图片示例如下:
[root@centos]#vim test.log
23:14 506.877
23:19 501.068
23:24 493.254
23:29 469.184
23:34 460.161
23:39 426.065
23:44 429.734
23:49 409.255
23:54 423.512
23:59 390.676
然后编写gnuplot的配置文件如下:
[root@centos]#vim log.conf
set terminal png truecolor size 550,250 #指定输出成png图片,且图片大小为550×250,需要ligpng支持,采用默认颜色设定
set output "log.png" #指定输出png图片的文件名
set autoscale #轴向标记自动控制
set xdata time #X