HBase JMX metrics

HBase exposes several metrics via JMX beans, some of which are similar to the Oracle performance counters recorded by AWR. Actually, they aren’t even *close* to what Oracle provides, but one can hope 🙂

Below is a simple example of how these can be exposed:

Download the jmx command line client jar from http://crawler.archive.org/cmdline-jmxclient/downloads.html
Configure HBase to expose JMX metrics as shown at http://hbase.apache.org/metrics.html
Run the following command on any server that can access ports 10101 and 10102 (as documented in the link above)

The first five and last five properties are shown below:

emgrid01:oracle:emprod1:/home/oracle>java -jar cmdline-jmxclient-0.10.3.jar monitorRole:welcome oradb01dxdu:10102 hadoop:service=RegionServer,name=RegionServerStatistics | awk '{l[NR]=$0} END {while (i < length(l)) {if (i <= 10) {print l[i]} else if (i >= length(l) - 10) {print l[i]};i++}}'

Attributes:
 blockCacheFree: NoDescription (type=java.lang.Long)
 compactionSizeNumOps: NoDescription (type=java.lang.Integer)
 compactionSizeAvgTime: NoDescription (type=java.lang.Long)
 compactionSizeMinTime: NoDescription (type=java.lang.Long)
 compactionSizeMaxTime: NoDescription (type=java.lang.Long)
 flushTimeNumOps: NoDescription (type=java.lang.Integer)
 flushTimeAvgTime: NoDescription (type=java.lang.Long)
 flushTimeMinTime: NoDescription (type=java.lang.Long)
 flushTimeMaxTime: NoDescription (type=java.lang.Long)
 compactionTimeMinTime: NoDescription (type=java.lang.Long)
 compactionTimeMaxTime: NoDescription (type=java.lang.Long)
 flushSizeNumOps: NoDescription (type=java.lang.Integer)
 flushSizeAvgTime: NoDescription (type=java.lang.Long)
 flushSizeMinTime: NoDescription (type=java.lang.Long)
 flushSizeMaxTime: NoDescription (type=java.lang.Long)
 blockCacheSize: NoDescription (type=java.lang.Long)
Operations:
 resetAllMinMax: Reset (zero) All Min Max
  Parameters 0, return type=void

Pick one of the properties above, and pass it on the command line using the same command as above. In other words:

emgrid01:oracle:emprod1:/home/oracle>java -jar cmdline-jmxclient-0.10.3.jar monitorRole:welcome oradb01dxdu:10102 hadoop:service=RegionServer,name=RegionServerStatistics blockCacheSize
08/16/2011 21:39:01 -0400 org.archive.jmx.Client blockCacheSize: 1702296
emgrid01:oracle:emprod1:/home/oracle>

You can then log these in an RDBMS for periodic analysis, and create a “poor man’s” AWR for HBase.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.