Site icon Tutorial

Cluster monitoring using metrics

HBase emits metrics which adhere to the Hadoop Metrics API. Starting with HBase 0.95, HBase is configured to emit a default set of metrics with a default sampling period of every 10 seconds. You can use HBase metrics in conjunction with Ganglia. You can also filter which metrics are emitted and extend the metrics framework to capture custom metrics appropriate for your environment.

Metric Setup

For HBase 0.95 and newer, HBase ships with a default metrics configuration, or sink. This includes a wide variety of individual metrics, and emits them every 10 seconds by default. To configure metrics for a given region server, edit the conf/hadoop-metrics2-hbase.properties file. Restart the region server for the changes to take effect.

To change the sampling rate for the default sink, edit the line beginning with *.period. To filter which metrics are emitted or to extend the metrics framework

Disabling Metrics

To disable metrics for a region server, edit the conf/hadoop-metrics2-hbase.properties file and comment out any uncommented lines. Restart the region server for the changes to take effect.

Interface ClusterMetrics

Metrics information on the HBase cluster. ClusterMetrics provides clients with information such as:

ClusterMetrics.Option provides a way to get desired ClusterStatus information. The following codes will get all the cluster information.  If information about live servers is the only wanted. then codes in the following way:

Admin admin = connection.getAdmin();

ClusterMetrics metrics = admin.getClusterStatus(EnumSet.of(Option.LIVE_SERVERS));

Units of Measure for Metrics

Different metrics are expressed in different units, as appropriate. Often, the unit of measure is in the name (as in the metric shippedKBs). Otherwise, use the following guidelines. When in doubt, you may need to examine the source for a given metric.

Important Master Metrics

Counts are usually over the last metrics reporting interval.

Important RegionServer Metrics

Counts are usually over the last metrics reporting interval.

Exit mobile version