Centos6.4下Ganglia安装与配置

时间:2022-08-15 10:24:50
Centos6.4下Ganglia安装与配置

1、源码方式安装

1.1 首先安装Ganglia基础依赖包

[root@monitor ~]# yum install -y expat expat-devel pcre pcre-devel zlib cairo-devel libxml2-devel pango-devel pango libpng-devel libpng freetype freetype-devel libart_lgpl-devel apr-devel

1.2 接着安装apr、confuse、rrdtool

[root@monitor ~]# tar -zxvf apr-1.6.3.tar.gz 

[root@monitor ~]# cd apr-1.6.3

[root@monitor ~]#./configure

[root@monitor ~]#echo $?

[root@monitor ~]#make

[root@monitor ~]#make install

[root@node1 ~]# tar zxvf confuse-3.2.tar.gz

[root@node1 ~]# cd confuse-3.2.tar.gz 

[root@monitor confuse-3.2]# ./configure CFLAGS=-fPIC --disable-nls

[root@monitor confuse-3.2]# make

[root@monitor confuse-3.2]# make install 

[root@monitor ~]# tar zxvf rrdtool-1.7.0.tar.gz

[root@monitor ~]# cd rrdtool-1.7.0

[root@monitor rrdtool-1.7.0]# ./configure --disable-tcl --prefix=/opt/rrdtool

make时如果遇到错误:

Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 1.
BEGIN failed--compilation aborted at Makefile.PL line 1.
make[2]: *** [perl-piped] 错误 2
make[2]: 离开目录“/root/rrdtool-1.7.0/bindings”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/root/rrdtool-1.7.0/bindings”

make: *** [all-recursive] 错误 1

请执行以下操作:

[root@node1 rrdtool-1.7.0]# yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

[root@node1 rrdtool-1.7.0]#make

[root@node1 rrdtool-1.7.0]#make install

1.3 最后安装ganglia-gmetad

[root@monitor ganglia-3.7.2]# tar zxvf ganglia-3.7.2.tar.gz

[root@monitor ~]# cd ganglia-3.7.2

[root@monitor ganglia-3.7.2]# ./configure --prefix=/opt/app/ganglia --with-static-modules --enable-status --with-gmetad --with-python=/usr --with-librrd=/opt/rrdtool --with-libexpat=/usr --with-libconfuse=/usr/local --with-libpcre=/usr/local

出现这个表示编译成功
Welcome to..
     ______                  ___
    / ____/___ _____  ____ _/ (_)___ _
   / / __/ __ `/ __ \/ __ `/ / / __ `/
  / /_/ / /_/ / / / / /_/ / / / /_/ /
  \____/\__,_/_/ /_/\__, /_/_/\__,_/
                   /____/


Copyright (c) 2005 University of California, Berkeley

Version: 3.7.2
Library: Release 3.7.2 0:0:0
Type "make" to compile.

[root@monitor ganglia-3.7.2]# make;make install

[root@monitor ganglia-3.7.2]#cd gmetad

[root@monitor gmetad]# cp gmetad.conf /opt/app/ganglia/etc/

[root@monitor gmetad]# cp gmetad.init /etc/init.d/gmetad

修改/etc/init.d/gmetad文件中gmetad命令的默认路径

chkconfig --add gmetad

[root@monitor gmetad]# ip route add 239.2.11.71 dev eth0

说明:239.2.11.71这个地址是Ganglia默认的多播地址,将这个地址绑定到相应的网卡设备上。设置多播地址后,Ganglia服务端就可以发送和接受多播信息。

至此,ganglia-gmetad安装完成。

1.4 Ganglia客户端的安装