There are several configuration files that need to be set up for Ganglia. Use the following instructions ot install the configuration files for Ganglia:
Extract the Ganglia configuration files.
From the downloaded
scripts.zipfile (downloaded in Download Companion Files), copy the files in theconfiguration_files/gangliadirectory to a temporary directory.The
gangliadirectory contains two sub-directories,objectsandscripts.Copy the configuration files.
On the Ganglia server host, complete the following instructions:
Create a directory for the
objectsdirectory and copy theobjectsfiles:mkdir -p /usr/libexec/hdp/ganglia cp $tmp-directory/ganglia/objects/* /usr/libexec/hdp/ganglia
Copy the contents of the
scriptsdirectory toinit.ddirectory.cp $tmp-directory/ganglia/scripts/* /etc/init.d
On each host in the cluster, copy the Ganglia monitoring init script to
init.ddirectory:cp $tmp-directory/ganglia/scripts/hdp-gmond /etc/init.d
Set up Ganglia hosts.
On the Ganglia server, execute the following commands to configure the
gmondcollector:/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPJobTracker -m /usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode -m /usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPSlaves -m /usr/libexec/hdp/ganglia/setupGanglia.sh -t
If HBase is installed, execute the following command on the HBase Master host machine:
/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseMaster -m
On the NameNode and SecondaryNameNode servers, execute the following command to configure the
gmondemitters:/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode
On the JobTracker server, execute the following command to configure the
gmondemitters:/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPJobTracker
On all hosts, execute the following command to configure the
gmondemitters:/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPSlaves
If HBase is installed, execute the following command on the HBase Master host machine to configure the
gmondemitter:/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseMaster
Set up configurations.
On the Ganglia server, confirm that the
bindproperty in each of the following files is set to the Ganglia server hostname:/etc/ganglia/hdp/HDPNameNode/conf.d/gmond.master.conf /etc/ganglia/hdp/HDPJobTracker/conf.d/gmond.master.conf /etc/ganglia/hdp/HDPSlaves/conf.d/gmond.master.conf
And if HBase is installed:
/etc/ganglia/hdp/HDPHBaseMaster/conf.d/gmond.master.conf
On the Ganglia server, open the
/etc/ganglia/hdp/gmetad.conffile and confirm that thedata_sourceproperties are set to the Ganglia server hostname.For example:
data_source "HDPSlaves" $my.ganglia.server.hostname:8660 data_source "HDPNameNode" $my.ganglia.server.hostname:8661 data_source "HDPJobTracker" $my.ganglia.server.hostname:8662
And if HBase is installed:
data_source "HDPHBaseMaster" $my.ganglia.server.hostname:8663
On all hosts except the Ganglia server, open the slave configuration files and confirm that the
hostproperty is set to the Ganglia Server hostname:/etc/ganglia/hdp/HDPNameNode/conf.d/gmond.slave.conf /etc/ganglia/hdp/HDPJobTracker/conf.d/gmond.slave.conf /etc/ganglia/hdp/HDPSlaves/conf.d/gmond.slave.conf
And if HBase is installed:
/etc/ganglia/hdp/HDPHBaseMaster/conf.d/gmond.slave.conf
Set up Hadoop metrics. On each host in the cluster, complete the following instructions:
Stop the Hadoop services using the instructions provided here.
Change to the Hadoop configuration directory.
cd $HADOOP_CONF_DIR
where
$HADOOP_CONF_DIRis the is the directory for storing the Hadoop configuration files. For example,/etc/hadoop/conf.Copy the Ganglia metrics properties file into place.
mv hadoop-metrics2.properties-GANGLIA hadoop-metrics2.properties
Edit the metrics properties file and set the Ganglia server hostname.
namenode.sink.ganglia.servers=$my.ganglia.server.hostname:8661 datanode.sink.ganglia.servers=$my.ganglia.server.hostname:8660 jobtracker.sink.ganglia.servers=$my.ganglia.server.hostname:8662 tasktracker.sink.ganglia.servers=$my.ganglia.server.hostname:8660 maptask.sink.ganglia.servers=$my.ganglia.server.hostname:8660 reducetask.sink.ganglia.servers=$my.ganglia.server.hostname:8660
Restart the Hadoop services using the instructions provided here.

