| <!DOCTYPE html> |
| |
| |
| <!-- |
| | Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/xdoc/metrics.xml |
| | Rendered using Apache Maven Fluido Skin 1.12.0 |
| --> |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| <meta name="generator" content="Apache Maven Doxia Site Renderer 1.11.1" /> |
| <title>Apache HBase – |
| Apache HBase (TM) Metrics |
| </title> |
| <link rel="stylesheet" href="./css/apache-maven-fluido-1.12.0.min.css" /> |
| <link rel="stylesheet" href="./css/site.css" /> |
| <link rel="stylesheet" href="./css/print.css" media="print" /> |
| <script src="./js/apache-maven-fluido-1.12.0.min.js"></script> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta> |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css"/> |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css"/> |
| <link rel="stylesheet" href="css/site.css"/> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script> |
| </head> |
| <body class="topBarEnabled"> |
| <a class="github-fork-ribbon right-top" href="https://github.com/apache/hbase" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a> |
| <header id="topbar" class="navbar navbar-fixed-top "> |
| <div class="navbar-inner"> |
| <div class="container"> |
| <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar"> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </a> |
| <nav class="nav-collapse"> |
| <ul class="nav"> |
| <li class="dropdown"> |
| <a class="dropdown-toggle" data-toggle="dropdown">Apache HBase Project <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="index.html" title="Overview">Overview</a></li> |
| <li><a href="https://www.apache.org/licenses/" title="License">License</a></li> |
| <li><a href="downloads.html" title="Downloads">Downloads</a></li> |
| <li><a href="https://issues.apache.org/jira/browse/HBASE?report=com.atlassian.jira.plugin.system.project:changelog-panel#selectedTab=com.atlassian.jira.plugin.system.project%3Achangelog-panel" title="Release Notes">Release Notes</a></li> |
| <li><a href="coc.html" title="Code Of Conduct">Code Of Conduct</a></li> |
| <li><a href="http://blogs.apache.org/hbase/" title="Blog">Blog</a></li> |
| <li><a href="mailing-lists.html" title="Mailing Lists">Mailing Lists</a></li> |
| <li><a href="team.html" title="Team">Team</a></li> |
| <li><a href="sponsors.html" title="HBase Sponsors">HBase Sponsors</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> |
| <li><a href="poweredbyhbase.html" title="Powered by HBase">Powered by HBase</a></li> |
| <li><a href="resources.html" title="Other resources">Other resources</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a class="dropdown-toggle" data-toggle="dropdown">Project Information <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="summary.html" title="Project Summary">Project Summary</a></li> |
| <li><a href="dependency-info.html" title="Dependency Information">Dependency Information</a></li> |
| <li><a href="scm.html" title="Source Repository">Source Repository</a></li> |
| <li><a href="issue-management.html" title="Issue Tracking">Issue Tracking</a></li> |
| <li><a href="dependency-management.html" title="Dependency Management">Dependency Management</a></li> |
| <li><a href="dependencies.html" title="Dependencies">Dependencies</a></li> |
| <li><a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a></li> |
| <li><a href="plugin-management.html" title="Plugin Management">Plugin Management</a></li> |
| <li><a href="plugins.html" title="Plugins">Plugins</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a class="dropdown-toggle" data-toggle="dropdown">Documentation and API <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="book.html" target="_blank" title="Reference Guide">Reference Guide</a></li> |
| <li><a href="apache_hbase_reference_guide.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a></li> |
| <li><a href="book.html#quickstart" target="_blank" title="Getting Started">Getting Started</a></li> |
| <li><a href="apidocs/index.html" target="_blank" title="User API">User API</a></li> |
| <li><a href="testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a></li> |
| <li><a href="devapidocs/index.html" target="_blank" title="Developer API">Developer API</a></li> |
| <li><a href="testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a></li> |
| <li><a href="http://abloz.com/hbase/book.html" target="_blank" title="中文参考指南(单页)">中文参考指南(单页)</a></li> |
| <li><a href="book.html#faq" target="_blank" title="FAQ">FAQ</a></li> |
| <li><a href="book.html#other.info" target="_blank" title="Videos/Presentations">Videos/Presentations</a></li> |
| <li><a href="https://cwiki.apache.org/confluence/display/HADOOP2/Hbase" target="_blank" title="Wiki">Wiki</a></li> |
| <li><a href="acid-semantics.html" target="_blank" title="ACID Semantics">ACID Semantics</a></li> |
| <li><a href="book.html#arch.bulk.load" target="_blank" title="Bulk Loads">Bulk Loads</a></li> |
| <li><a title="Metrics">Metrics</a></li> |
| <li><a href="book.html#replication" target="_blank" title="Cluster replication">Cluster replication</a></li> |
| <li class="dropdown-submenu"> |
| <a href="" title="1.4 Documentation">1.4 Documentation</a> |
| <ul class="dropdown-menu"> |
| <li><a href="1.4/book.html" target="_blank" title="Ref Guide">Ref Guide</a></li> |
| <li><a href="1.4/book.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a></li> |
| <li><a href="1.4/apidocs/index.html" target="_blank" title="User API">User API</a></li> |
| <li><a href="1.4/devapidocs/index.html" target="_blank" title="Developer API">Developer API</a></li> |
| </ul> |
| </li> |
| <li class="dropdown-submenu"> |
| <a href="" title="2.3 Documentation">2.3 Documentation</a> |
| <ul class="dropdown-menu"> |
| <li><a href="2.3/book.html" target="_blank" title="Ref Guide">Ref Guide</a></li> |
| <li><a href="2.3/apache_hbase_reference_guide.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a></li> |
| <li><a href="2.3/apidocs/index.html" target="_blank" title="User API">User API</a></li> |
| <li><a href="2.3/testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a></li> |
| <li><a href="2.3/devapidocs/index.html" target="_blank" title="Developer API">Developer API</a></li> |
| <li><a href="2.3/testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a></li> |
| </ul> |
| </li> |
| <li class="dropdown-submenu"> |
| <a href="" title="2.4 Documentation">2.4 Documentation</a> |
| <ul class="dropdown-menu"> |
| <li><a href="2.4/book.html" target="_blank" title="Ref Guide">Ref Guide</a></li> |
| <li><a href="2.4/apache_hbase_reference_guide.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a></li> |
| <li><a href="2.4/apidocs/index.html" target="_blank" title="User API">User API</a></li> |
| <li><a href="2.4/testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a></li> |
| <li><a href="2.4/devapidocs/index.html" target="_blank" title="Developer API">Developer API</a></li> |
| <li><a href="2.4/testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a></li> |
| </ul> |
| </li> |
| <li class="dropdown-submenu"> |
| <a href="" title="2.5 Documentation">2.5 Documentation</a> |
| <ul class="dropdown-menu"> |
| <li><a href="2.5/apidocs/index.html" target="_blank" title="User API">User API</a></li> |
| <li><a href="2.5/testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a></li> |
| <li><a href="2.5/devapidocs/index.html" target="_blank" title="Developer API">Developer API</a></li> |
| <li><a href="2.5/testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="http://www.apache.org/foundation/" target="_blank" title="Apache Software Foundation">Apache Software Foundation</a></li> |
| <li><a href="http://www.apache.org/foundation/how-it-works.html" target="_blank" title="How Apache Works">How Apache Works</a></li> |
| <li><a href="http://www.apache.org/foundation/sponsorship.html" target="_blank" title="Sponsoring Apache">Sponsoring Apache</a></li> |
| </ul> |
| </li> |
| </ul> |
| </nav> |
| <div class="nav-collapse"> |
| <form id="search-form" action="https://www.google.com/search" method="get" class="navbar-search pull-right" > |
| <input value="hbase.apache.org" name="sitesearch" type="hidden"/> |
| <input class="search-query" name="q" id="query" type="text" placeholder="Search with Google..." /> |
| </form> |
| </div> |
| </div> |
| </div> |
| </header> |
| <div class="container container-top"> |
| <header> |
| <div id="banner"> |
| <div class="pull-left"><a href="./" id="bannerLeft"><img src="" alt="" style="" /></a></div> |
| <div class="pull-right"><a href="http://hbase.apache.org/" id="bannerRight"><img src="images/hbase_logo_with_orca_large.png" alt="Apache HBase" style="" /></a></div> |
| <div class="clear"><hr/></div> |
| </div> |
| |
| </header> |
| <main id="bodyColumn" > |
| |
| |
| <section> |
| <h2><a name="Introduction"></a>Introduction</h2> |
| |
| <p> |
| Apache HBase (TM) emits Hadoop <a class="externalLink" href="http://hadoop.apache.org/core/docs/stable/api/org/apache/hadoop/metrics/package-summary.html">metrics</a>. |
| </p> |
| </section> |
| <section> |
| <h2><a name="Setup"></a>Setup</h2> |
| |
| <p>First read up on Hadoop <a class="externalLink" href="http://hadoop.apache.org/core/docs/stable/api/org/apache/hadoop/metrics/package-summary.html">metrics</a>. |
| If you are using ganglia, the <a class="externalLink" href="https://cwiki.apache.org/confluence/display/HADOOP2/GangliaMetrics">GangliaMetrics</a> |
| wiki page is useful read.</p> |
| |
| <p>To have HBase emit metrics, edit <code>$HBASE_HOME/conf/hadoop-metrics.properties</code> |
| and enable metric 'contexts' per plugin. As of this writing, hadoop supports |
| <b>file</b> and <b>ganglia</b> plugins. |
| Yes, the hbase metrics files is named hadoop-metrics rather than |
| <i>hbase-metrics</i> because currently at least the hadoop metrics system has the |
| properties filename hardcoded. Per metrics <i>context</i>, |
| comment out the NullContext and enable one or more plugins instead. |
| </p> |
| |
| <p> |
| If you enable the <i>hbase</i> context, on regionservers you'll see total requests since last |
| metric emission, count of regions and storefiles as well as a count of memstore size. |
| On the master, you'll see a count of the cluster's requests. |
| </p> |
| |
| <p> |
| Enabling the <i>rpc</i> context is good if you are interested in seeing |
| metrics on each hbase rpc method invocation (counts and time taken). |
| </p> |
| |
| <p> |
| The <i>jvm</i> context is |
| useful for long-term stats on running hbase jvms -- memory used, thread counts, etc. |
| As of this writing, if more than one jvm is running emitting metrics, at least |
| in ganglia, the stats are aggregated rather than reported per instance. |
| </p> |
| </section> |
| |
| <section> |
| <h2><a name="Using_with_JMX"></a>Using with JMX</h2> |
| |
| <p> |
| 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. |
| </p> |
| <section> |
| <h2><a name="Enable_HBase_stats_collection"></a>Enable HBase stats collection</h2> |
| |
| <p> |
| To enable JMX support in HBase, first edit |
| <code>$HBASE_HOME/conf/hadoop-metrics.properties</code> to support |
| metrics refreshing. (If you've running 0.94.1 and above, or have already configured |
| <code>hadoop-metrics.properties</code> for another output context, |
| you can skip this step). |
| </p> |
| |
| <div class="source"><pre class="prettyprint"> |
| # Configuration of the "hbase" context for null |
| hbase.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread |
| hbase.period=60 |
| |
| # Configuration of the "jvm" context for null |
| jvm.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread |
| jvm.period=60 |
| |
| # Configuration of the "rpc" context for null |
| rpc.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread |
| rpc.period=60 |
| </pre></div> |
| </section> |
| <section> |
| <h2><a name="Setup_JMX_remote_access"></a>Setup JMX remote access</h2> |
| |
| <p> |
| For remote access, you will need to configure JMX remote passwords |
| and access profiles. Create the files: |
| </p> |
| |
| <dl> |
| |
| <dt><code>$HBASE_HOME/conf/jmxremote.passwd</code> (set permissions |
| to 600)</dt> |
| |
| <dd> |
| |
| <div class="source"><pre class="prettyprint"> |
| monitorRole monitorpass |
| controlRole controlpass |
| </pre></div> |
| </dd> |
| |
| |
| <dt><code>$HBASE_HOME/conf/jmxremote.access</code></dt> |
| |
| <dd> |
| |
| <div class="source"><pre class="prettyprint"> |
| monitorRole readonly |
| controlRole readwrite |
| </pre></div> |
| </dd> |
| </dl> |
| </section> |
| <section> |
| <h2><a name="Configure_JMX_in_HBase_startup"></a>Configure JMX in HBase startup</h2> |
| |
| <p> |
| Finally, edit the <code>$HBASE_HOME/conf/hbase-env.sh</code> |
| script to add JMX support: |
| </p> |
| |
| <dl> |
| |
| <dt><code>$HBASE_HOME/conf/hbase-env.sh</code></dt> |
| |
| <dd> |
| |
| <p>Add the lines:</p> |
| |
| <div class="source"><pre class="prettyprint"> |
| HBASE_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false" |
| HBASE_JMX_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.password.file=$HBASE_HOME/conf/jmxremote.passwd" |
| HBASE_JMX_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.access.file=$HBASE_HOME/conf/jmxremote.access" |
| |
| export HBASE_MASTER_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.port=10101" |
| export HBASE_REGIONSERVER_OPTS="$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.port=10102" |
| </pre></div> |
| </dd> |
| </dl> |
| |
| <p> |
| 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 |
| <b><code>hadoop</code></b> domain in JMX. |
| </p> |
| </section> |
| <section> |
| <h2><a name="Understanding_HBase_Metrics"></a>Understanding HBase Metrics</h2> |
| |
| <p> |
| For more information on understanding HBase metrics, see the <a href="book.html#hbase_metrics">metrics section</a> in the Apache HBase Reference Guide. |
| </p> |
| </section> |
| </section> |
| |
| |
| </main> |
| </div> |
| <hr/> |
| <footer> |
| <div class="container"> |
| <div class="row"> |
| <div style="float: left"> |
| Copyright ©2007–2024 <a href="https://www.apache.org">The Apache Software Foundation</a>. All rights reserved.<br> |
| Apache HBase, HBase, Apache, the Apache HBase logo and the ASF logo are either registered trademarks or trademarks of the Apache Software Foundation. |
| All other marks mentioned may be trademarks or registered trademarks of their respective owners. |
| </div> |
| <div style="float: right"> |
| Last Published: 2024-09-27 |
| </div> |
| </div> |
| <p id="poweredBy" class="pull-right"><a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a> |
| </p> |
| </div> |
| </footer> |
| <script> |
| if(anchors) { |
| anchors.add(); |
| } |
| </script> |
| </body> |
| </html> |