How to monitor major compaction of hbase

hbase, java

Solution

HBase exports lots of metrics through Apache Hadoop's metrics systems. These metrics are also exposed through jmx. So ganglia or jmx are pretty easy ways to get started on watching the metrics that HBase exports. Other options include OpenTSDB and propriety entries.

Inside of ganglia or jmx the metric you will want to look at is the hbase.regionserver.compactionQueueSize. That is the number of compactions that have been scheduled.

The RegionServer UI also includes a copy of some of the metrics, including compactionQueueSize. Later versions of HBase will look better but this gives an example.

Problem

I want to monitor major compaction of the hbase. For each table I would like to know - when it starts (by hbase or by user) - when it finished How can I monitor this? - via JMX ? - via UI ? In general what additional parameters should I monitor to detect that the major compaction is needed?

Original source