1 Ganglia installation and deployment
(1) Installation
Installation planning:
install epel-release in hadoop102, 103, 104:
sudo yum -y install epel-release
Install at 102: web, gmetad, gmod:
sudo yum -y install ganglia-gmetad
sudo yum -y install ganglia-web
sudo yum -y install ganglia-gmond
Install gmod on 103, 104:
sudo yum -y install ganglia-gmond
(2) Configuration
Check the ip in cmd on the host:
modify the configuration file /etc/httpd/conf.d/ganglia.conf at 102:
sudo vim /etc/httpd/conf.d/ganglia.conf
#修改为
# Ganglia monitoring system php web frontend#
Alias /ganglia /usr/share/ganglia
<Location/ganglia> # Require local
# 通过 windows 访问 ganglia,需要配置 Linux 对应的主机(windows)ip 地址
Require ip 192.168.30.1
# Require ip 10.1.2.3
# Require host example.org
</Location>
Modify the configuration file /etc/ganglia/gmetad.conf at 102:
sudo vim /etc/ganglia/gmetad.conf
#修改为:
data_source "my cluster" hadoop102
Modify the configuration file /etc/ganglia/gmond.conf at 102 103 104:
sudo vim /etc/ganglia/gmond.conf
#修改为:
cluster {
name = "my cluster"
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
udp_send_channel {
#bind_hostname= yes # Highly recommended, soon to be default.# This option tells gmond to use a source
address
# that resolvesto the machine's hostname.
Without
# this, the metricsmay appear to come from
any
# interface and the DNS names associated with # those IPs will be used to create the RRDs.
# mcast_join = 239.2.11.71
# 数据发送给 hadoop102
host = hadoop102
port = 8649
ttl = 1
}
udp_recv_channel {
# mcast_join = 239.2.11.71
port = 8649
# 接收来自任意连接的数据
bind = 0.0.0.0
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
}
Modify the configuration file /etc/selinux/config at 102:
sudo vim /etc/selinux/config
#修改为:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values:
#enforcing - SELinux security policy is enforced.
#permissive - SELinux prints warnings instead of enforcing. #disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values: #targeted - Targeted processes are protected, #mls - Multi Level Security protection.
SELINUXTYPE=targeted
Screaming reminder: selinux needs to be restarted to take effect. If you don’t want to restart, you can temporarily take effect:
sudo setenforce 0
(3) Startup
at 102 103 104:
sudo systemctl start gmond
Start at 102:
sudo systemctl start httpd
sudo systemctl start gmetad
Modify the permissions of the /var/lib/ganglia directory:
sudo chmod -R 777 /var/lib/ganglia
Open the ganglia page in Windows browser: http://hadoop102/ganglia
2 Operate Flume test monitoring
More input when starting the Flume task:
-Dflume.root.logger=INFO,console
-Dflume.monitoring.type=ganglia
-Dflume.monitoring.hosts=hadoop102:8649