Saturday, May 18, 2013

Monitoring HBase using Ganglia


Configuring HBase to start emitting metrics to Ganglia is a pretty simple task. Although we can make almost (that’s for being on the safer side) any bigdata technology report  its metrics to Ganglia using JMX, but some of the technologies like HBase, Hadoop, Kafka etc. have got in-built support for reporting their metrics to Ganglia, which makes our task much more easier.

For obvious reasons, it’s essential to have a Ganglia cluster before you can start to report HBase metrics on to it and browse it's UI. For details on the components of Ganglia and how to install it, you can access the following link:


Setup gmond servers on all the nodes of your hbase cluster which you want to emit metrics/whose metrics you would be interested to see on the Ganglia Web UI.

Configurations:


Once, you have Ganglia gmond servers setup on all the hbase cluster nodes being considered for reporting, follow the steps below on all the nodes of your HBase cluster

  • Edit /hbase_setup/conf/hadoop-metrics.properties on all the nodes of the hbase cluster and add the following lines to it. 
/hbase-setup/conf/hadoop-metrics.properties

hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
hbase.period=10
hbase.servers=master.node.IP.address:8649
Note: If the version of Ganglia installed is 3.1.x the hbase.class would be assigned org.apache.hadoop.metrics.ganglia.GangliaContext31 and if the Ganglia version is older than this, it's value would be org.apache.hadoop.metrics.ganglia.GangliaContext

Next it’s time to let Ganglia metad server know that your HBase cluster nodes would be reporting their metrics to it. For this, edit /etc/ganglia/gmetad.conf(or where ever the gmetad.conf file is located) file by specifying the data_source in the configuration. The format of the data_source line is as follows:

data_source "hbase-cluster" gmetad_server_ip_address:8655         

You can provide any name to your cluster, which would replace hbase-cluster in the above entry and “gmetad_server_ip_address” needs to be replaced by the IP address of your gmetad server.

That’s it. Quite easy right? Now, just advance further by restarting your hbase cluster and check out the Ganglia UI for the HBase cluster nodes metrics.

1 comment:

  1. Nice blog Jayati... May i know which Hadoop Distribution was this tested on?

    ReplyDelete