两台机器
192.168.147.72 gmetad gweb
192.168.150.140 gmond
==========安装【gmetad】机器==========
#查看EPEL源
rpm -qa | grep epel
#如果没有安装EPEL源
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#安装依赖
yum -y install httpd-devel automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig
#安装ganglia-gmetad 和 ganglia-web
yum search ganglia
yum install -y ganglia-gmetad.x86_64 ganglia-web.x86_64
yum install -y ganglia-gmond.x86_64
rpm -qa | grep ganglia
#配置gmetad
data_source "flumeDataSrc" 10 192.168.150.140:8650
data_source "meta_gmond" 10 192.168.147.72:8649
#修改ganglia-web Apache配置
vi /etc/httpd/conf.d/ganglia.conf
#文件内容Deny from all 为 allow from all
#设置开机自启
chkconfig --add gmetad
chkconfig --add httpd
#关闭防火墙
service iptables stop
#关闭SELINUX
vi /etc/selinux/config,把SELINUX=enforcing改成SELINUX=disable;需要重启机器
可以使用命令setenforce 0来关闭selinux而不需要重启,刷新页面,即可访问!但此方法只是一权宜之计。要想永久修改selinux设置,还是要使用第一种方法
#启动服务
service gmetad start
service httpd start
service gmond start
#验证是否启动成功
service gmetad status
service gmond status
#web查看
http://192.168.147.72/ganglia
==========安装【gmond】机器==========
#查看EPEL源
rpm -qa | grep epel
#如果没有安装EPEL源
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#安装依赖
yum -y install httpd-devel automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig
#安装监控节点的gmond,【gmetad】节点也可以安装一个,监控【gmetad】节点的参数
yum search ganglia
yum install -y ganglia-gmond.x86_64
#配置gmond
cluster {
name = "flumeDataSrc"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
host {
location = "unspecified"
}
udp_send_channel {
#mcast_join = 239.2.11.71
host=192.168.150.140
port = 8650
ttl = 1
}
udp_recv_channel {
#mcast_join = 239.2.11.71
port = 8650
#bind = 239.2.11.71
#retry_bind = true
# Size of the UDP buffer. If you are handling lots of metrics you really
# should bump it up to e.g. 10MB or even higher.
# buffer = 10485760
}
tcp_accept_channel {
port = 8650
# If you want to gzip XML output
gzip_output = no
}
#配置开机自启
chkconfig –add gmond
#启动服务
service gmond start
#验证是否启动成功
service gmond status
==========注意事项==========
RRD存储位置:/var/lib/ganglia/rrds
WEB工程位置:/usr/share/ganglia/
#如果出现有图没有数据的情况,检查是否两台机器时间不同步
#安装ntpdate
yum install ntpdate
#同步时间
ntpdate time.windows.com
==========flume监控配置==========
vim conf/flume-env.sh
export JAVA_OPTS="-Xms100m -Xmx2000m -Dcom.sun.management.jmxremote -Dflume.monitoring.type=ganglia -Dflume.monitoring.hosts=192.168.150.140:8650"