1
2
|
# yum install epel-release
# yum install ganglia-web ganglia-gmetad ganglia-gmond
|
1
2
3
|
# vi /etc/ganglia/gmetad.conf #修改以下两项
data_source
"Hadoop"
192.168.18.215 192.168.18.216 192.168.18.217 192.168.18.218192.168.18.219
case_sensitive_hostnames 1
|
1
2
|
# rm /etc/httpd/conf.d/ganglia.conf
# ln -s /usr/share/ganglia /var/www/html/ganglia
|
1
2
3
4
|
# systemctl start httpd
# systemctl start gmetad
# systemctl enable httpd
# systemctl enable gmetad
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# yum install ganglia-gmond
# vi /etc/ganglia/gmond.conf
……
cluster{
name =
"Hadoop"
#集群名,和上面那个一样
owner =
"unspecified"
latlong =
"unspecified"
url =
"unspecified"
}
/* Thehost section describes attributes of the host, like the location */
host {
location =
"unspecified"
}
/*Feel
free
to specify as many udp_send_channels as you like. Gmond
used to only support having a single channel*/
udp_send_channel{
#bind_hostname = yes # Highly recommended,soon to be default.
# This option tells gmond to use asource address
# that resolves to themachine's hostname. Without
# this, the metrics mayappear to come from any
# interface and the DNSnames associated with
# those IPs will be usedto create the RRDs.
#mcast_join = 239.2.11.71 #关闭多播
host = 192.168.18.215
#添加发送IP/主机名
port = 8649
#默认端口
ttl = 1
}
/* Youcan specify as many udp_recv_channels as you like as well. */
udp_recv_channel{
#mcast_join = 239.2.11.71
port = 8649
bind = 192.168.18.215
#接收地址
retry_bind =
true
# Size of the UDP buffer. If you are handlinglots of metrics you really
# should bump it up to e.g. 10MB or evenhigher.
# buffer = 10485760
}
……
|
1
|
# scp /etc/ganglia/gmond.conf root@HMaster1:/etc/ganglia/gmond.conf #分别拷贝HSlave0、1、2
|
1
2
|
# systemctl start gmond
# systemctl enable gmond
|
1
2
3
4
5
6
7
8
9
10
|
# vi /opt/hadoop-2.6.0/etc/hadoop/hadoop-metrics2.properties
*.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
*.sink.ganglia.period=10
*.sink.ganglia.supportsparse=
true
*.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
*.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
namenode.sink.ganglia.servers=192.168.18.215:8649
#当有多个ganglia监控系统时,以逗号分隔
datanode.sink.ganglia.servers=192.168.18.215:8649
#都指定ganglia服务器
resourcemanager.sink.ganglia.servers=192.168.18.215:8649
nodemanager.sink.ganglia.servers=192.168.18.215:8649
|
1
2
3
4
5
|
# vi /opt/hbase-1.0.1.1/conf/hadoop-metrics2-hbase.properties
*.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
*.sink.ganglia.period=10
hbase.sink.ganglia.period=10
hbase.sink.ganglia.servers=192.168.18.215:8649
|
1
2
3
4
5
6
|
# stop-dfs.sh
# stop-yarn.sh
# stop-hbase.sh
# start-dfs.sh
# start-yarn.sh
# start-hbase.sh #HRegionServer节点需要手动启动(hbase-daemon.sh start regionserver)
|