ganglia多点系统监控实践 (二)
在上一篇文章中讲述了ganglia的系统架构和工作原理,现在介绍一下在RedHat CentOS中对J2EE系统运行状态监控的
2句口水:
1.如果是在安装多次失败或者正在寻求一个简单有效安装 ganglia 的方法,当你能看见这篇文章的时候你非常幸运了,因为这是作者经过多次失败的经验的总结,得出的最佳的安装方法了。
2.本文还讲述对ganglia 集群分组的配置方法。
一、实现原理
- Gmond 代理- 收集、度量每个服务器的信息
- gmetad 管理 – 度量agent 对一个或多个具体的任务导向的服务器上安装
- Apache web serv – 展示服务器度量的信息
- Multicast 多播 – 所有gmond节点都能够听和报告整个群集状态
- 故障转移 – gmetad的有能力的群集节点切换公制数据是调查
- 重量轻- 低开销度量收集和运输
- 可以运行在 windows、Linux、FreeBSD、Solaris 等不同的操作系统平台
如图所示:
二、安装、配置
ganglia 主要配置文件
/ect/gmond.conf
/etc/gmetad.conf
/usr/local/apache/htdocs/ganglia/conf.php
第一步:
// 1.安装所有需要的软件
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum install rrdtool ganglia ganglia-gmetad ganglia-gmond ganglia-web httpd php apr apr-util
第二步: //配置代理节点
//1配置代理节点
cluster {
name = "cluster1" //
owner = "owner1"
latlong = "unspecified"
url = "unspecified"
}
udp_send_channel {
port = 8649
ttl = 1
}
udp_recv_channel {
port = 8649
}
//2. 加入系统服务,并且在系统启动时候自动运行
chkconfig gmond on
service gmond start
第三步: //配置管理节点
// 1.编辑管理节点配置文件
vim /etc/gmetad.conf
编辑 data_source 部分
data_source "cluster1" 192.168.1.253 // a)my cluster 是一个分组的名称 ,对应代理节点中的 name = "cluster1" 名称。
b)192.168.1.253是一个代理节点的主机ip
//2.加入系统服务,并且在系统启动时候自动运行
chkconfig gmetad on
service gmetad start
第四步:
// 将Apache Httpd加入系统服务,并且在系统启动时候自动运
chkconfig httpd on
service httpd start
安装代理节点
//1.安装所需要的软件
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum install ganglia-gmond
//2.配置代理节点
cluster {
name = "cluster2" //
owner = "owner1"
latlong = "unspecified"
url = "unspecified"
}
udp_send_channel {
port = 8649
ttl = 1
}
udp_recv_channel {
port = 8649
}
//2.加入系统服务,并且在系统启动时候自动运行
chkconfig gmond on
service gmond start
三、ganglia 对MySQL进行监控
1下载mySQL监控脚本 http://www.javabloger.com/att/gmetric-mysql.sh ,进行chmod ,让该脚本可执行。
2修改脚本中的MySQL 用户名和密码
3在crond中加入 * * * * * /path/to/gmetric-mysql.sh > /dev/null 2>&1 这句话
4.重启 监控节点,重启管理节点,代理节点上修改配置,都需要重启管理节点。

–end–

本文由J2ee企业顾问-黄毅创作,并已采用创作共用署名2.5中国大陆版许可证授权。
评论
Comment from gourmet
Time 2010年08月24日 at 10:27 下午
I really like this blog. great post keep up the good work. I have bookmarked your site.
Comment from mexican
Time 2010年10月5日 at 1:56 下午
I really like this blog.
Comment from Lucas
Time 2010年10月30日 at 3:38 上午
You made some good points there. I did a search on the subject and hardly found any specific details on other sites, but then great to be here, seriously, thanks.
- Lucas







Comment from agent
Time 2010年06月20日 at 8:02 下午
路过,支持一下