blob: 8dc759f3709c3c3abd5686d820bbb01efd0aa1ee [file] [log] [blame]
<!DOCTYPE html>
<!--
Generated by Apache Maven Doxia at 2019-10-18
Rendered using Reflow Maven Skin 1.1.1 (http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<title>Apache HBase &#x2013;
Apache HBase (TM) Metrics
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta http-equiv="content-language" content="en" />
<link href="http://netdna.bootstrapcdn.com/bootswatch/2.3.2/spacelab/bootstrap.min.css" rel="stylesheet" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" rel="stylesheet" />
<link href="./css/bootswatch.css" rel="stylesheet" />
<link href="./css/reflow-skin.css" rel="stylesheet" />
<link href="./css/lightbox.css" rel="stylesheet" />
<link href="./css/site.css" rel="stylesheet" />
<link href="./css/print.css" rel="stylesheet" media="print" />
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body class="page-metrics project-hbase" data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target="#top-nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse collapse" id="top-nav-collapse">
<ul class="nav pull-right">
<li class="dropdown">
<a href="#" 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="license.html" title="License">License</a></li>
<li ><a href="http://www.apache.org/dyn/closer.cgi/hbase/" title="Downloads" class="externalLink">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" class="externalLink">Release Notes</a></li>
<li ><a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a></li>
<li ><a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a></li>
<li ><a href="source-repository.html" title="Source Repository">Source Repository</a></li>
<li ><a href="https://reviews.apache.org" title="ReviewBoard" class="externalLink">ReviewBoard</a></li>
<li ><a href="team-list.html" title="Team">Team</a></li>
<li ><a href="sponsors.html" title="Thanks">Thanks</a></li>
<li ><a href="http://blogs.apache.org/hbase/" title="Blog" class="externalLink">Blog</a></li>
<li ><a href="resources.html" title="Other resources">Other resources</a></li>
</ul>
</li>
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="book.html" title="Reference Guide" target="_blank">Reference Guide</a></li>
<li ><a href="apache_hbase_reference_guide.pdf" title="Reference Guide (PDF)" target="_blank">Reference Guide (PDF)</a></li>
<li ><a href="book.html#quickstart" title="Getting Started" target="_blank">Getting Started</a></li>
<li ><a href="apidocs/index.html" title="User API" target="_blank">User API</a></li>
<li ><a href="devapidocs/index.html" title="Developer API" target="_blank">Developer API</a></li>
<li ><a href="xref/index.html" title="X-Ref">X-Ref</a></li>
<li ><a href="http://abloz.com/hbase/book.html" title="中文参考指南(单页)" target="_blank" class="externalLink">中文参考指南(单页)</a></li>
<li ><a href="book.html#faq" title="FAQ" target="_blank">FAQ</a></li>
<li ><a href="book.html#other.info" title="Videos/Presentations" target="_blank">Videos/Presentations</a></li>
<li ><a href="http://wiki.apache.org/hadoop/Hbase" title="Wiki" target="_blank" class="externalLink">Wiki</a></li>
<li ><a href="acid-semantics.html" title="ACID Semantics" target="_blank">ACID Semantics</a></li>
<li ><a href="book.html#arch.bulk.load" title="Bulk Loads" target="_blank">Bulk Loads</a></li>
<li class="active"><a href="" title="Metrics" target="_blank">Metrics</a></li>
<li ><a href="cygwin.html" title="HBase on Windows" target="_blank">HBase on Windows</a></li>
<li ><a href="replication.html" title="Cluster replication" target="_blank">Cluster replication</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">0.94 Documentation <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="0.94/apidocs/index.html" title="API" target="_blank">API</a></li>
<li ><a href="0.94/xref/index.html" title="X-Ref" target="_blank">X-Ref</a></li>
<li ><a href="0.94/book.html" title="Ref Guide (single-page)" target="_blank">Ref Guide (single-page)</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="http://www.apache.org/foundation/" title="Apache Software Foundation" target="_blank" class="externalLink">Apache Software Foundation</a></li>
<li ><a href="http://www.apache.org/foundation/how-it-works.html" title="How Apache Works" target="_blank" class="externalLink">How Apache Works</a></li>
<li ><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsoring Apache" target="_blank" class="externalLink">Sponsoring Apache</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<!-- Masthead
================================================== -->
<header>
<div class="jumbotron subhead">
<div class="row" id="banner">
<div class="span12">
<div class="pull-left">
<a href="http://hbase.apache.org/" id="bannerLeft"><img src="images/hbase_logo.png" alt='"'Apache HBase'"' /></a>
</div>
<div class="pull-right">
<a href="http://hbasecon.com/" id="bannerRight"><img src="images/hbasecon2015.30percent.png" alt='"'Apache HBase Orca'"' /></a>
</div>
</div>
</div>
</div>
<div>
<ul class="breadcrumb">
<li class="projectVersion version-date">Version: 1.4.11</li>
<li class="divider">|</li>
<li class="publishDate version-date">Last Published: 2019-10-18</li>
</ul>
</div>
</header>
<div class="main-body">
<div class="row">
<div class="span12">
<div class="body-content">
<!-- Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. -->
<div class="section">
<div class="page-header">
<h2 id="Introduction">Introduction</h2>
</div>
<p> Apache HBase (TM) emits Hadoop <a class="externalLink" href="http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/metrics/package-summary.html">metrics</a>. </p>
</div>
<div class="section">
<h2 id="Setup">Setup</h2>
<p>First read up on Hadoop <a class="externalLink" href="http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/metrics/package-summary.html">metrics</a>. If you are using ganglia, the <a class="externalLink" href="http://wiki.apache.org/hadoop/GangliaMetrics">GangliaMetrics</a> wiki page is useful read.</p>
<p>To have HBase emit metrics, edit <tt>$HBASE_HOME/conf/hadoop-metrics.properties</tt> 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>
</div>
<div class="section">
<h2 id="Using_with_JMX">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>
<div class="section">
<h2 id="Enable_HBase_stats_collection">Enable HBase stats collection</h2>
<p> To enable JMX support in HBase, first edit <tt>$HBASE_HOME/conf/hadoop-metrics.properties</tt> to support metrics refreshing. (If you've running 0.94.1 and above, or have already configured <tt>hadoop-metrics.properties</tt> for another output context, you can skip this step). </p>
<div class="source">
<pre>
# Configuration of the &quot;hbase&quot; context for null
hbase.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
hbase.period=60
# Configuration of the &quot;jvm&quot; context for null
jvm.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
jvm.period=60
# Configuration of the &quot;rpc&quot; context for null
rpc.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
rpc.period=60
</pre>
</div>
</div>
<div class="section">
<h2 id="Setup_JMX_remote_access">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>
<tt>$HBASE_HOME/conf/jmxremote.passwd</tt> (set permissions to 600)
</dt>
<dd>
<div class="source">
<pre>
monitorRole monitorpass
controlRole controlpass
</pre>
</div>
</dd>
<dt>
<tt>$HBASE_HOME/conf/jmxremote.access</tt>
</dt>
<dd>
<div class="source">
<pre>
monitorRole readonly
controlRole readwrite
</pre>
</div>
</dd>
</dl>
</div>
<div class="section">
<h2 id="Configure_JMX_in_HBase_startup">Configure JMX in HBase startup</h2>
<p> Finally, edit the <tt>$HBASE_HOME/conf/hbase-env.sh</tt> script to add JMX support: </p>
<dl>
<dt>
<tt>$HBASE_HOME/conf/hbase-env.sh</tt>
</dt>
<dd>
<p>Add the lines:</p>
<div class="source">
<pre>
HBASE_JMX_OPTS=&quot;-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false&quot;
HBASE_JMX_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.password.file=$HBASE_HOME/conf/jmxremote.passwd&quot;
HBASE_JMX_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.access.file=$HBASE_HOME/conf/jmxremote.access&quot;
export HBASE_MASTER_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.port=10101&quot;
export HBASE_REGIONSERVER_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.port=10102&quot;
</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><tt>hadoop</tt></b> domain in JMX. </p>
</div>
<div class="section">
<h2 id="Understanding_HBase_Metrics">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>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- /container -->
<!-- Footer
================================================== -->
<footer class="well">
<div class="container">
<div class="row">
<div class="span3 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Apache HBase Project</li>
<li >
<a href="index.html" title="Overview">Overview</a>
</li>
<li >
<a href="license.html" title="License">License</a>
</li>
<li >
<a href="http://www.apache.org/dyn/closer.cgi/hbase/" title="Downloads" class="externalLink">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" class="externalLink">Release Notes</a>
</li>
<li >
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
<li >
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li >
<a href="source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li >
<a href="https://reviews.apache.org" title="ReviewBoard" class="externalLink">ReviewBoard</a>
</li>
<li >
<a href="team-list.html" title="Team">Team</a>
</li>
<li >
<a href="sponsors.html" title="Thanks">Thanks</a>
</li>
<li >
<a href="http://blogs.apache.org/hbase/" title="Blog" class="externalLink">Blog</a>
</li>
<li >
<a href="resources.html" title="Other resources">Other resources</a>
</li>
</ul>
</div>
<div class="span3 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Documentation</li>
<li >
<a href="book.html" title="Reference Guide" target="_blank">Reference Guide</a>
</li>
<li >
<a href="apache_hbase_reference_guide.pdf" title="Reference Guide (PDF)" target="_blank">Reference Guide (PDF)</a>
</li>
<li >
<a href="book.html#quickstart" title="Getting Started" target="_blank">Getting Started</a>
</li>
<li >
<a href="apidocs/index.html" title="User API" target="_blank">User API</a>
</li>
<li >
<a href="devapidocs/index.html" title="Developer API" target="_blank">Developer API</a>
</li>
<li >
<a href="xref/index.html" title="X-Ref">X-Ref</a>
</li>
<li >
<a href="http://abloz.com/hbase/book.html" title="中文参考指南(单页)" target="_blank" class="externalLink">中文参考指南(单页)</a>
</li>
<li >
<a href="book.html#faq" title="FAQ" target="_blank">FAQ</a>
</li>
<li >
<a href="book.html#other.info" title="Videos/Presentations" target="_blank">Videos/Presentations</a>
</li>
<li >
<a href="http://wiki.apache.org/hadoop/Hbase" title="Wiki" target="_blank" class="externalLink">Wiki</a>
</li>
<li >
<a href="acid-semantics.html" title="ACID Semantics" target="_blank">ACID Semantics</a>
</li>
<li >
<a href="book.html#arch.bulk.load" title="Bulk Loads" target="_blank">Bulk Loads</a>
</li>
<li class="active">
<a href="#" title="Metrics" target="_blank">Metrics</a>
</li>
<li >
<a href="cygwin.html" title="HBase on Windows" target="_blank">HBase on Windows</a>
</li>
<li >
<a href="replication.html" title="Cluster replication" target="_blank">Cluster replication</a>
</li>
</ul>
</div>
<div class="span3 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">0.94 Documentation</li>
<li >
<a href="0.94/apidocs/index.html" title="API" target="_blank">API</a>
</li>
<li >
<a href="0.94/xref/index.html" title="X-Ref" target="_blank">X-Ref</a>
</li>
<li >
<a href="0.94/book.html" title="Ref Guide (single-page)" target="_blank">Ref Guide (single-page)</a>
</li>
<li class="nav-header">ASF</li>
<li >
<a href="http://www.apache.org/foundation/" title="Apache Software Foundation" target="_blank" class="externalLink">Apache Software Foundation</a>
</li>
<li >
<a href="http://www.apache.org/foundation/how-it-works.html" title="How Apache Works" target="_blank" class="externalLink">How Apache Works</a>
</li>
<li >
<a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsoring Apache" target="_blank" class="externalLink">Sponsoring Apache</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<div class="container subfooter">
<div class="row">
<div class="span12">
<p class="pull-right"><a href="#">Back to top</a></p>
<p class="copyright">Copyright &copy;2007-2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</p>
<p><a href="http://github.com/andriusvelykis/reflow-maven-skin" title="Reflow Maven skin">Reflow Maven skin</a> by <a href="http://andrius.velykis.lt" target="_blank" title="Andrius Velykis">Andrius Velykis</a>.</p>
</div>
</div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="./js/lightbox.min.js"></script>
<script src="./js/reflow-scroll.js"></script>
<script src="./js/reflow-skin.js"></script>
</body>
</html>