ganlgia-rrdcached
一、介绍
rrdcached是一个高性能的RRD缓存守护进程,在不带来大量磁盘读/写文件i/o负荷的情况下,允许gmetad实例维护多个RRD文件。rrdcached可通过命令套接字控制,并且包含在大多数linux版本的标准rrdtool安装包中。
但是版本有要求,1.4.1以上的rrdtool已包含rrdcached,redhat6自带的是1.3.8的,如果使用,需要升级版本
二、编译安装包
rrdtool编译依赖包
cairo-devel is needed by rrdtool-1.4.7-1.el6.x86_64
freetype-devel is needed by rrdtool-1.4.7-1.el6.x86_64
gcc-c++ is needed by rrdtool-1.4.7-1.el6.x86_64
glib2-devel is needed by rrdtool-1.4.7-1.el6.x86_64
gettext-devel is needed by rrdtool-1.4.7-1.el6.x86_64
intltool is needed by rrdtool-1.4.7-1.el6.x86_64
libpng-devel is needed by rrdtool-1.4.7-1.el6.x86_64
libxml2-devel is needed by rrdtool-1.4.7-1.el6.x86_64
lua-devel is needed by rrdtool-1.4.7-1.el6.x86_64
openssl-devel is needed by rrdtool-1.4.7-1.el6.x86_64
pango-devel is needed by rrdtool-1.4.7-1.el6.x86_64
python-devel >= 2.3 is needed by rrdtool-1.4.7-1.el6.x86_64
ruby is needed by rrdtool-1.4.7-1.el6.x86_64
ruby-devel is needed by rrdtool-1.4.7-1.el6.x86_64
tcl-devel is needed by rrdtool-1.4.7-1.el6.x86_64
tk-devel is needed by rrdtool-1.4.7-1.el6.x86_64
xulrunner-devel is needed by rrdtool-1.4.7-1.el6.x86_64
zlib-devel is needed by rrdtool-1.4.7-1.el6.x86_64
因为是在powerlinux上安装
rpmbuild --rebuild rrdtool-1.4.7-1.rf.src.rpm
yum install perl-rrdtool-1.4.7-1.el6.x86_64.rpm rrdtool-1.4.7-1.el6.x86_64.rpm
三、配置
rrdcached基本思想就是在内存中合并更新,批量写磁盘,可以减轻写入磁盘的io负载,同时gweb也可以直接利用rrdcached中的数据进行绘图,也能减轻gweb绘图时请求的io负载,所以配置时建议gmetad和gweb都配置
rrd
[root@mast1 ~]# cat /etc/sysconfig/rrdcached
RUN_RRDCACHED=1
RRDCACHED_USER="rrdcached"
OPTS="-l /var/lib/ganglia/rrds -w 300 -z 300"
PIDFILE="/var/run/rrdcached/rrdcached.pid"
SOCKFILE="/var/run/rrdcached/rrdcached.sock"
SOCKPERMS=0660
安装包不同有可能默认的rrdcached配置文件也不同,如下也可参考
[root@cdh1 conf.d]# cat /etc/sysconfig/rrdcached
# Settings for rrdcached
#OPTIONS="-l unix:/var/rrdtool/rrdcached/rrdcached.sock -s rrdcached -m 664 -b /var/rrdtool/rrdcached"
OPTIONS="-l /var/rrdtool/rrdcached/rrdcached.sock -p /var/rrdtool/rrdcached/rrdcached.pid -s rrdcached -m 664 -b /var/lib/ganglia/rrds"
RRDC_USER=rrdcached
gmetad
[root@mast1 ~]# grep -i rrdcached /etc/init.d/gmetad
export RRDCACHED_ADDRESS=/var/run/rrdcached/rrdcached.sock
gweb
[root@mast1 ~]# grep -i rrdcached /usr/share/ganglia/conf_default.php
$conf['rrdcached_socket'] = "/var/run/rrdcached/rrdcached.sock";
四、启动
gmond-》rrdcached-》gmetad-》gweb