更新源
yum install wget gcc make rsync
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
1. 安装php支持
yum install php-common php-cli php-gb php
2. 安装ganglia及其相关组件
server端:yum install rrdtool rrdtool-devel ganglia-web ganglia-gmetad ganglia-gmond ganglia-gmond-python httpd apr-devel zlib-devel libconfuse-devel expat-devel pcre-devel
client端:yum install ganglia-gmond
[root@test1 ganglia]# pwd
/etc/ganglia
[root@test1 ganglia]# egrep -v "^#|^$" gmetad.conf
data_source "chenlaisoft.sz" localhost
gridname "ganglia.chenlaisoft.sz"
setuid_username nobody
case_sensitive_hostnames 0
[root@test1 ganglia]#
4. 创建rrds目录
mkdir -p /var/lib/ganglia/rrds
chown nobody:nobody /var/lib/ganglia/rrds
chmod a+w /var/lib/ganglia/rrds
5. 关闭SELinux不然无法访问监控的web的页面
vi /etc/selinux/config
SELINUX=disable
以上方法需要重启机器
防火墙规则设置
iptables -I INPUT 3 -p tcp -m tcp --dport 80 -j ACCEPT
iptables -I INPUT 3 -p udp -m udp --dport 8649 -j ACCEPT
service iptables save
service iptables restart
6. 启动相关服务
service gmond restart
service gmetad restart
service httpd restart
[root@vm244-009-zabbix conf.d]# chkconfig gmond on
[root@vm244-009-zabbix conf.d]# chkconfig gmetad on
[root@vm244-009-zabbix conf.d]# chkconfig httpd on
Forbidden
You don't have permission to access /ganglia on this server.
#vi /etc/httpd/conf.d/ganglia.conf
# Ganglia monitoring system php web frontend
#
Alias /ganglia /usr/share/ganglia
<Location /ganglia>
Order deny,allow
Deny from all
#Allow from 127.0.0.1
Allow from all
Allow from ::1
# Allow from .example.com
</Location>
客户端安装:
gmond -t >gmond.conf
client端:yum install ganglia-gmond
cluster {
name = "chenlaisoft.sz"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
host {
location = "test.chenlaisoft.sz"
}
udp_send_channel {
host = 192.168.1.156
port = 8649
ttl = 1
}
udp_recv_channel {
port = 8649
retry_bind = true
}