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.
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, see http://hadoop.apache.org/docs/current/api/org/apache/hadoop/metrics2/package-summary.html
By default, HBase emits a large number of metrics per region server. Ganglia may have difficulty processing all these metrics. Consider increasing the capacity of the Ganglia server or reducing the number of metrics emitted by HBase. See Metrics Filtering.
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.
Rather than listing each metric which HBase emits by default, you can browse through the available metrics, either as a JSON output or via JMX. At this time, the JSON output does not include the description field which is included in the JMX view. Different metrics are exposed for the Master process and each region server process.
Procedure 17.1. Access a JSON Output of Available Metrics
After starting HBase, access the region server's web UI, at
http://localhost:60030
by default.
Click the Metrics Dump link near the top. The metrics for the region server are presented as a dump of the JMX bean in JSON format.
To view metrics for the Master, connect to the Master's web UI instead (defaults to
http://localhost:60010
) and click its Metrics
Dump link.
Procedure 17.2. Browse the JMX Output of Available Metrics
You can use many different tools to view JMX content by browsing MBeans. This procedure uses jvisualvm, which is an application usually available in the JDK.
Start HBase, if it is not already running.
Run the command jvisualvm command on a host with a GUI display. You can launch it from the command line or another method appropriate for your operating system.
Be sure the VisualVM-MBeans plugin is installed. Browse to → . Click Installed and check whether the plugin is listed. If not, click Available Plugins, select it, and click . When finished, click .
To view details for a given HBase process, double-click the process in the Local sub-tree in the left-hand panel. A detailed view opens in the right-hand panel. Click the MBeans tab which appears as a tab in the top of the right-hand panel.
To access the HBase metrics, navigate to the appropriate sub-bean:
Master:
→ → →RegionServer:
→ → →The name of each metric and its current value is displayed in the Attributes tab. For a view which includes more details, including the description of each attribute, click the Metadata tab.
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.
Metrics that refer to a point in time are usually expressed as a timestamp.
Metrics that refer to an age (such as ageOfLastShippedOp
) are usually
expressed in milliseconds.
Metrics that refer to memory sizes are in bytes.
Sizes of queues (such as sizeOfLogQueue
) are expressed as the number of
items in the queue. Determine the size by multiplying by the block size (default is 64
MB in HDFS).
Metrics that refer to things like the number of a given type of operations (such as
logEditsRead
) are expressed as an integer.
Previously, this section contained a list of the most important RegionServer metrics. However, the list was extremely out of date. In some cases, the name of a given metric has changed. In other cases, the metric seems to no longer be exposed. An effort is underway to create automatic documentation for each metric based upon information pulled from its implementation.