From 062042ba83651b8495bc0330023ae7c7c47a38d4 Mon Sep 17 00:00:00 2001
From: Michael Stack
Date: Thu, 10 Sep 2009 05:03:35 +0000
Subject: [PATCH] HBASE-1722 Add support for exporting HBase metrics via JMX
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@813229 13f79535-47bb-0310-9956-ffa450edef68
---
CHANGES.txt | 1 +
.../documentation/content/xdocs/metrics.xml | 113 ++++++++++++++++++
.../hadoop/hbase/ipc/HBaseRpcMetrics.java | 6 +-
.../hbase/master/metrics/MasterMetrics.java | 8 +-
.../metrics/RegionServerMetrics.java | 14 ++-
5 files changed, 136 insertions(+), 6 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index 05466fa181f..d81a17cbca7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -34,6 +34,7 @@ Release 0.21.0 - Unreleased
HBASE-1800 Too many ZK connections
HBASE-1819 Update to 0.20.1 hadoop and zk 3.2.1
HBASE-1820 Update jruby from 1.2 to 1.3.1
+ HBASE-1722 Add support for exporting HBase metrics via JMX
OPTIMIZATIONS
HBASE-1765 Delay Result deserialization until asked for and permit
diff --git a/src/docs/src/documentation/content/xdocs/metrics.xml b/src/docs/src/documentation/content/xdocs/metrics.xml
index c8744f438de..b01d7bd06cc 100644
--- a/src/docs/src/documentation/content/xdocs/metrics.xml
+++ b/src/docs/src/documentation/content/xdocs/metrics.xml
@@ -63,5 +63,118 @@
in ganglia, the stats are aggregated rather than reported per instance.
+
+
+ Using with JMX
+
+ In addition to the standard output contexts supported by the Hadoop
+ metrics package, you can also export HBase metrics via Java Management
+ Extensions (JMX). This will allow viewing HBase stats in JConsole or
+ any other JMX client.
+
+
+ Enable HBase stats collection
+
+ To enable JMX support in HBase, first edit
+ $HBASE_HOME/conf/hadoop-metrics.properties to support
+ metrics refreshing. (If you've already configured
+ hadoop-metrics.properties for another output context,
+ you can skip this step).
+
+
+
+
+ Setup JMX remote access
+
+ For remote access, you will need to configure JMX remote passwords
+ and access profiles. Create the files:
+
+
+
$HBASE_HOME/conf/jmxremote.passwd (set permissions
+ to 600)
+
+
+
+
+
$HBASE_HOME/conf/jmxremote.access
+
+
+
+
+
+
+ Configure JMX in HBase startup
+
+ Finally, edit the $HBASE_HOME/conf/hbase-env.sh and
+ $HBASE_HOME/bin/hbase scripts for JMX support:
+
+
+
$HBASE_HOME/conf/hbase-env.sh
+
+
Add the lines:
+
+
+
$HBASE_HOME/bin/hbase
+
+
Towards the end of the script, replace the lines:
+
+
+ with the lines: (adding the "HBASE_OPTS=..." lines for "master" and
+ "regionserver" commands)
+
+
+
+
+
+ After restarting the processes you want to monitor, you should now be
+ able to run JConsole (included with the JDK since JDK 5.0) to view
+ the statistics via JMX. HBase MBeans are exported under the
+ hadoop domain in JMX.
+