1 把 Ganglia 安装至 namenode

  1.1 sudo apt-get install ganglia-monitor ganglia-webfrontend gmetad

  1.2 sudo gedit /etc/ganglia/gmond.conf

    1.2.1  setuid = yes    --》    setuid =no

    1.2.2  cluster块中的name,改成name =”hadoop-test”

  1.3 重启gmond

  1.4 sudo apt-get install rrdtool

  1.5 sudo gedit /etc/ganglia/gmetad.conf

    data_source “hadoop-test” namenode:8649 datanode1:8649 datanode2:8649

  1.6 sudo /etc/init.d/gmetad restart

  1.7 sudo /etc/init.d/ganglia-monitor restart

  1.8 sudo ln -s /usr/share/ganglia-webfront /var/www/ganglia

  1.9 sudo /etc/init.d/apache2 restart

  1.10 sudo gedit $hadoop_home/conf/hadoop-metrics2.properties   

# Configuration of the “dfs” context for ganglia

dfs.class=org.apache.hadoop.metrics.ganglia.GangliaContext

dfs.period=10

dfs.servers=239.2.11.71:8649

# Configuration of the “mapred” context for ganglia

mapred.class=org.apache.hadoop.metrics.ganglia.GangliaContext

mapred.period=10

mapred.servers=239.2.11.71:8649

# Configuration of the “jvm” context for ganglia

jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext

jvm.period=10

jvm.servers=239.2.11.71:8649

2 安装datanode客户端

  2.1 sudo apt-get install ganglia-monitor

  2.2 并配置1.10