ganglia监控hadoop2.0配置方法
前提:hadoop2.0集群已安装ganglia监控工具
第一步:
Hadoop用户登录集群每一个节点,
修改文件:vi /opt/hadoop-2.0.0-cdh4.5.0/etc/hadoop/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
#注意端口是你的gmetad配置的端口
namenode.sink.ganglia.servers=239.2.11.71:8661
resourcemanager.sink.ganglia.servers=239.2.11.71:8661
datanode.sink.ganglia.servers=239.2.11.71:8661
nodemanager.sink.ganglia.servers=239.2.11.71:8661
maptask.sink.ganglia.servers=239.2.11.71:8661
reducetask.sink.ganglia.servers=239.2.11.71:8661
第二步:
在master节点重启hadoop集群
hadoop用户执行:
sh /opt/zookeeper-3.4.5-cdh4.4.0/bin/zkServer.sh restart
sh /opt/hadoop-2.0.0-cdh4.5.0/sbin/hadoop-daemon.sh start journalnode
sh /opt/hadoop-2.0.0-cdh4.5.0/sbin/stop-dfs.sh
sh /opt/hadoop-2.0.0-cdh4.5.0/bin-mapreduce1/stop-mapred-ha.sh
sh /opt/hadoop-2.0.0-cdh4.5.0/sbin/start-dfs.sh
sh /opt/hadoop-2.0.0-cdh4.5.0/bin-mapreduce1/start-mapred-ha.sh
sh /opt/hadoop-2.0.0-cdh4.5.0/bin/hdfs haadmin -DfSHAadmin -failover nn1 nn0
重启ganglia的gmaster进程
Root用户在172.16.2.30执行:
service gmaster restart