ganglia3.5 安装

来源:互联网 发布:天龙八部全套源码资源 编辑:程序博客网 时间:2024/04/30 12:19

ganglia3.5 安装

1.安装apache,php

2.安装依赖包:

yum -y install apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel \

rpmbuild glib2-devel dbus-devel freetype-devel fontconfig-devel gcc-c++ expat-devel \

python-devel libXrender-devel pcre pcre-devel 

编译安装libconfuse

http://pkgs.repoforge.org/libconfuse/libconfuse-devel-2.6-2.el5.rf.x86_64.rpm

http://pkgs.repoforge.org/libconfuse/libconfuse-2.6-2.el5.rf.x86_64.rpm

rpm -ivh libconfuse-* 

3.安装RRDTool,存储ganglia收集的数据

cd /tmp/

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz

tar zxvf rrdtool*

cd rrdtool-*

./configure --prefix=/usr

make -j8

make install

which rrdtool

ldconfig

ldconfig -p | grep rrd # make sure you have the new rrdtool libraries linked.

4.安装ganglia服务端

http://sourceforge.net/projects/ganglia/files/ganglia%20monitoring%20core/ 

tar -xf ganglia-3.5.0.tar.gz && cd ganglia-3.5.0   

./configure --with-gmetad  --sysconfdir=/etc/ganglia --disable-python 

make && make install   

(如果出现/usr/local/lib/libpython2.7.a: could not read symbols: Bad value 错误,需要在编译的时候加入 --disable-python )

cp gmond/gmond.init /etc/rc.d/init.d/gmond   

cp gmetad/gmetad.init /etc/rc.d/init.d/gmetad   

chkconfig --add gmond && chkconfig gmond on   

chkconfig --add gmetad && chkconfig gmetad on 

修改/etc/rc.d/init.d/gmetad和/etc/rc.d/init.d/gmond,分别指定如下参数:  

GMETAD=/usr/local/sbin/gmetad  

GMOND=/usr/local/sbin/gmond 

mkdir /etc/ganglia # where config files go,if existing ,no making

gmond -t | tee /etc/ganglia/gmond.conf # generate initial gmond config,if existing ,no making

cp gmetad/gmetad.conf /etc/ganglia/ # initial gmetad configuration

mkdir -p /var/lib/ganglia/rrds # place where RRDTool graphs will be stored

chown nobody:nobody /var/lib/ganglia/rrds # make sure RRDTool can write here.

5.配置ganglia

通过修改/etc/ganglia下的gmond.init 和 gmetad.init文件,配置ganglia的监控配置

gmetad.init:

#data_source "test-hadoop-cluster" 10.13.82.48:8660

#data_source "test-storm-cluster" 10.10.51.39:8661

#gridname "msohu"

gmond.init的配置分为组播与单播

组播,所有client配置相同:

cluster { #监控的组

  name = "test-storm-cluster"

}

udp_send_channel { #发送广播或单播信息

  mcast_join = 239.2.11.61 #广播地址

  port = 8661 #端口

}

udp_recv_channel { #接收广播或单播信息

  mcast_join = 239.2.11.61 #广播地址

  port = 8661 #端口

}

tcp_accept_channel { #发送数据给ganglia server

  port = 8661

}

单播,有一个机器获得组内其他机器的监控信息,ganglia server再从该机器获取全部数据:

获得组内其他机器的监控信息的机器配置

udp_send_channel {

  host = 10.13.82.48

  port = 8670

}

udp_recv_channel {

  port = 8670

}

tcp_accept_channel {

  port = 8660

}

其他机器配置

udp_send_channel {

  host = 10.13.82.48

  port = 8670

}

6.安装ganglia-web:

wget http://sourceforge.net/projects/ganglia/files/ganglia-web/3.5.4/ganglia-web-3.5.4.tar.gz/download 

tar -zxvf ganglia-web-3.5.4.tar.gz  

cp -r ganglia-web-3.5.4  /var/www/html/ganglia/ # this is the web interface

cd /var/www/html/ganglia/

vim Makefile,修改参数GDESTDIR,然后执行make install进行安装: 

GDESTDIR = /var/www/html/ganglia

make install

cp conf_default.php conf.php

vim conf.php,修改如下参数:

$conf['gmetad_root'] = "/var/lib/ganglia"; 

$conf['rrds'] = "${conf['gmetad_root']}/rrds";    

$conf['rrdtool'] = "/usr/bin/rrdtool"; 

$conf['external_location'] = "http://SERVER/ganglia";  //把SERVER替换成自己的ip

$conf['case_sensitive_hostnames'] = false; 

启动并访问:

service gmetad start 

service gmond start 

http://SERVER/ganglia/  //把SERVER替换成自己的ganglia服务器IP

7.CLIENT端安装:

比较简单,只需要安装gmond及其依赖即可.

tar -xf ganglia-3.5.0.tar.gz && cd ganglia-3.5.0 

./configure  --sysconfdir=/etc/ganglia  --disable-python

make && make install 

cp gmond/gmond.init /etc/rc.d/init.d/gmond  

chkconfig --add gmond && chkconfig gmond on  

修改/etc/rc.d/init.d/gmond,指定如下参数: 

GMOND=/usr/local/sbin/gmond 

复制gmond.conf 配置文件到客户端目录/etc/ganglia ,做修改,然后启动客户端:service gmond start 



参考文章:

http://ganglia.info/  官网

http://heipark.iteye.com/blog/1197866  原理讲解

http://share.blog.51cto.com/278008/1054385/  安装

http://slaytanic.blog.51cto.com/2057708/808981/  安装



原创粉丝点击