我的ganglia配置过程

早就听说ganglia是HPC monitor的NO.1,可一直没时间安装,今天折腾了几乎一天,
终于把ganglia配置好了,记下来安装过程以供同行参考!
===============================
主页:http://ganglia.sourceforge.net/
下载页:http://sourceforge.net/projects/ganglia
===============================
Introduction:
Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRDtool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on thousands of clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes.
More details...
 --------------------------------------------------------------------
安装过程:
我使用的安装包(从上述下载页面下载):
ganglia-3.0.3.tar.gz
authd-0.2.1.tar.gz(包含gexec所需的源文件,头文件)
gexec-0.3.4.tar.gz
libe-0.2.2.tar.gz(包含gexec所需的源文件,头文件)
 
ganglia 是分布式的监控系统,有两个Daemon, 分别是:客户端Ganglia Monitoring Daemon (gmond)和服务端Ganglia Meta Daemon (gmetad),还有Ganglia PHP Web Frontend(基于web的动态访问方式)组成。是一个Linux下图形化监控系统运行性能的软件,界面美观、丰富,功能强大。
首先安装rrdtool(Round Robin Database Tool),rrdtool是一个数据库软件。它是一个主要用于进行监控的数据库,与其它的数据库相比,具有以下4个特点:
(1).除了存储数据之外,它具有可以创建图形的工具;
(2).它的数据库文件大小是固定的,新的数据添加到已有数据的后面,当到了文件末尾的时候就开始从文件开始写数据,Round Robin就是指这个意思;
(3).一般的数据库只能存储数据本身,而rrd可以存储相对与以前的数据的变动;
(4).一般的数据库是在提供数据的时候才更新,而RRD是在每一个预先设好的时间间隔都会更新,每次更新的时候,time stamp也会存储进去。

RRDtool是系统存放和显示time-series (即网络带宽、温度、人数、服务器负载等) 。并且它提出有用的图表由处理数据强制执行有些数据密度。
Ganglia依赖以下包:
zlib-1.2.2-4
libpng-1.2.1-6
freetype2-2.1.7-2
libart_lgpl-2.3.16-1
rrdtool-1.2.11
perl
 
一. server端的安装
A.   先安装RRDTool,默认的安装路径:/usr/local/rrdtool-<VERSION>
tar -zxvf rrdtool-*.tar.gz
cd rrdtool-*
./configure ; make;  make install
安装好后,我的目录为 /usr/local/rrdtool-1.2.15/
------------------------------------------------------
B.  gmetad的安装(版本:3.0.3)
gmetad不是默认安装的,安装时需要加参数 --with-gmetad 。即rrdtool库及其头文件必须存在,默认的路径是/usr/include/rrd.h和 /usr/lib/librrd.a,如果在安装rrdtool时安在了不同的路径下,这里需要指明它们的路径。
我的rrd安装目录为 /usr/local/rrdtool-1.2.15/。
 
 
tar –zxvf ganglia-3.0.3.tar.gz
cd ganglia-*
./configure  CFLAGS="-I/usr/local/rrdtool-1.2.15/include" /
CPPFLAGS="-I/usr/local/rrdtool-1.2.15/include" LDFLAGS="-L/usr/local/rrdtool-1.2.15/lib" --with-gmetad /
--enable-gexec
make;
make install

然后将gmetad.init文件拷贝到 /etc/init.d/:
cp ganglia-3.0.3/gmetad/gmetad.init   /etc/init.d/gmetad
将配置文件拷贝到/etc目录下:
cp ganglia-3.0.3/gmetad/gmetad.conf   /etc/gmetad.conf
chkconfig --add gmetad
chkconfig --list gmetad
GMETAD 0:off 1:off 2:on 3:on 4:on 5:on 6:off 
 
修改 /etc/gmetad.conf文件:
data_source "softcorr cluster1" 192.168.0.175
setuid_username "root"
# default: "/var/lib/ganglia/rrds"
# rrd_rootdir "/some/other/place"
   rrd_rootdir "/usr/local/rrdtool-1.2.15"
data_source是最重要的参量,在GMOND的Cluser name配置必须与data_source的相同,这个参量被设置为
群的名字,被监测以便能监测集群状态。如果有二个或更多监测对象,当有一对象不能被监测,将读取data_source 配置的下一个对象。
 
 启动gmetad:
/sbin/service gmetad start
Starting GANGLIA gmetad: [ OK ]
验证gmetad正常工作:telnet localhost 8651
就可以得到监控的各个主机的状态。
----------------------------------------------------------- 
C.  安装Apache服务器  
rpm -qa | grep httpd 
如果结果显示为“httpd-2.0.40-21”或其他版本说明,则说明系统已经安装Apache服务器。
启动apache:/etc/rc.d/init.d/httpd restart
 
二 client端安装
安装ganglia:
tar zxvf ganglia-3.0.3.tar.gz
cd ganglia-3.0.3
./configure --prefix=/usr/local/ganglia
make; make install
cd ganglia-3.0.3/gmond
gmond –t > /etc/gmond.conf
cp gmond.init /etc/init.d/gmond

chkconfig --add gmond
chkconfig --list gmond
gmond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
/sbin/service gmond start
Starting GANGLIA gmond: [ OK ]
验证gmond正常工作:telnet localhost 8649 就可以获取机群内运行gmond的主机的信息

配置gmond.conf:
/etc/gmond.conf:
globals {
setuid = no
user = nobody
cleanup_threshold = 300 /*secs */
}

修改监控组名称
cluster {
  name = "softcorr cluster1"
  .......
}
配置完成后重新启动gmond.
安装客户端完了以后,启动gmond曾失败过:
$gmond -d1
Error creating multicast server mcast_join=239.2.11.71 port=8649 mcast_if=NULL family='inet4'. Exiting.
查了一下ganglia的论坛,好像是route multicast的问题,我的客户端是fedaro core4,系统默认好像不支持多播(?),办法如下:
$/sbin/route add -host 239.2.11.71 dev eth0(重启后就没有这条路由了)
但可以把这句添加在/etc/rc.d/rc.local里面,让它每次启动时执行
239.2.11.71 是gmond.conf里的默认多播地址
然后启动gmond -d1就 OK了!
 
三. 安装web前端(可以在服务器或客户端安装)
cp -a ganglia-3.0.3/web /var/www/html/ganglia
确定web server支持PHP4
对apache来说,php模块mod_php的状态应该是enabled,默认一般就是
配制文件是/var/www/html/ganglia/conf.php
在浏览器地址栏输入 http://localhost/ganglia/应该可以看到有页面显示了。
======================================================
参考:
【注1】:gmond 配置文件说明:http://ganglia.sourceforge.net/docs/gmond.conf.html
【注2】:chinunix上一篇讨论文章:http://bbs.chinaunix.net/viewthread.php?tid=684899&extra=&page=3

【注3】: ganglia在线说明文档:http://ganglia.sourceforge.net/docs/ganglia.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值