1. 配置Ganglia3.1.7只需要修改三个文件 gmond.conf, gmead.conf, hadoop-metrics2.properties
2. gmetad.conf
1 gmetad.conf
data_source "cluster1 name" hostname1:8658
data_source "cluster2 name" hostname2:8659
3. gmond.conf
既是发送端又是接收端 每组集群可以配置一个 单播模式
globals {
daemonize = yes
setuid = no //default yes
user = nobody
debug_level = 0
max_udp_msg_len = 1472
mute = no
deaf = no
allow_extra_data = yes
host_dmax = 86400 /*secs. Expires (removes from web interface) hosts in 1 day */
host_tmax = 20 /*secs */
cleanup_threshold = 300 /*secs */
gexec = no
send_metadata_interval = 0 /*secs */
}
cluster {
name = "cluseter1 name" //修改名字
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 resolves to the machine's hostname. Without
# this, the metrics may 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
host = hostname1 //server
port = 8658
ttl = 1
}
udp_recv_channel {
#mcast_join = 239.2.11.71
port = 8658
bind = hostname //server
}
集群其他机器只是发送端
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 a source address
# that resolves to the machine's hostname. Without
# this, the metrics may 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
host = etl-jrdata-09.pekdc1.jdfin.local
port = 8658
ttl = 1
}
/* You can specify as many udp_recv_channels as you like as well. */
udp_recv_channel {
#mcast_join = 239.2.11.71
port = 8658
bind = 239.2.11.71
}
4. hadoop-metrics2.properties
*.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
*.sink.ganglia.period=10
*.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=hostname1:8658
resourcemanager.sink.ganglia.servers=hostname1:8658
datanode.sink.ganglia.servers=hostname1:8658
nodemanager.sink.ganglia.servers=hostname1:8658
maptask.sink.ganglia.servers=hostname1:8658
reducetask.sink.ganglia.servers=hostname1:8658
5.额外 Apache conf
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
# 在文件最后增加如下内容
# ganglia
Alias /ganglia "/soft/ganglia/ganglia-web-3.5.12"
<Directory "/soft/ganglia/ganglia-web-3.5.12">
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>