Published site at d5aaeee88b331e064830a2774f4fed238631457c.
[hbase-site.git] / metrics.html
1 <!DOCTYPE html>
2 <!--
3 | Generated by Apache Maven Doxia Site Renderer 1.6
4 | Rendered using Apache Maven Fluido Skin 1.5-HBASE
5 -->
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <meta charset="UTF-8" />
9 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10 <meta name="Date-Revision-yyyymmdd" content="20180311" />
11 <meta http-equiv="Content-Language" content="en" />
12 <title>Apache HBase &#x2013;
13 Apache HBase (TM) Metrics
14 </title>
15 <link rel="stylesheet" href="./css/apache-maven-fluido-1.5-HBASE.min.css" />
16 <link rel="stylesheet" href="./css/site.css" />
17 <link rel="stylesheet" href="./css/print.css" media="print" />
18
19
20 <script type="text/javascript" src="./js/apache-maven-fluido-1.5-HBASE.min.js"></script>
21
22
23
24 <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
25
26
27 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css"/>
28
29
30 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css"/>
31
32
33 <link rel="stylesheet" href="css/site.css"/>
34
35
36 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script>
37
38 </head>
39 <body class="topBarEnabled">
40
41
42
43
44
45 <div id="topbar" class="navbar navbar-fixed-top ">
46 <div class="navbar-inner">
47 <div class="container">
48 <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
49 <span class="icon-bar"></span>
50 <span class="icon-bar"></span>
51 <span class="icon-bar"></span>
52 </a>
53 <div class="nav-collapse">
54
55 <ul class="nav">
56 <li class="dropdown">
57 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache HBase Project <b class="caret"></b></a>
58 <ul class="dropdown-menu">
59
60 <li> <a href="index.html" title="Overview">Overview</a>
61 </li>
62
63 <li> <a href="license.html" title="License">License</a>
64 </li>
65
66 <li> <a href="http://www.apache.org/dyn/closer.cgi/hbase/" title="Downloads">Downloads</a>
67 </li>
68
69 <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>
70 </li>
71
72 <li> <a href="coc.html" title="Code Of Conduct">Code Of Conduct</a>
73 </li>
74
75 <li> <a href="http://blogs.apache.org/hbase/" title="Blog">Blog</a>
76 </li>
77
78 <li> <a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
79 </li>
80
81 <li> <a href="team-list.html" title="Team">Team</a>
82 </li>
83
84 <li> <a href="https://reviews.apache.org/" title="ReviewBoard">ReviewBoard</a>
85 </li>
86
87 <li> <a href="sponsors.html" title="Thanks">Thanks</a>
88 </li>
89
90 <li> <a href="poweredbyhbase.html" title="Powered by HBase">Powered by HBase</a>
91 </li>
92
93 <li> <a href="resources.html" title="Other resources">Other resources</a>
94 </li>
95 </ul>
96 </li>
97 <li class="dropdown">
98 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Information <b class="caret"></b></a>
99 <ul class="dropdown-menu">
100
101 <li> <a href="project-summary.html" title="Project Summary">Project Summary</a>
102 </li>
103
104 <li> <a href="dependency-info.html" title="Dependency Information">Dependency Information</a>
105 </li>
106
107 <li> <a href="team-list.html" title="Team">Team</a>
108 </li>
109
110 <li> <a href="source-repository.html" title="Source Repository">Source Repository</a>
111 </li>
112
113 <li> <a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
114 </li>
115
116 <li> <a href="dependency-management.html" title="Dependency Management">Dependency Management</a>
117 </li>
118
119 <li> <a href="dependencies.html" title="Dependencies">Dependencies</a>
120 </li>
121
122 <li> <a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a>
123 </li>
124
125 <li> <a href="integration.html" title="Continuous Integration">Continuous Integration</a>
126 </li>
127
128 <li> <a href="plugin-management.html" title="Plugin Management">Plugin Management</a>
129 </li>
130
131 <li> <a href="plugins.html" title="Plugins">Plugins</a>
132 </li>
133 </ul>
134 </li>
135 <li class="dropdown">
136 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation and API <b class="caret"></b></a>
137 <ul class="dropdown-menu">
138
139 <li> <a href="book.html" target="_blank" title="Reference Guide">Reference Guide</a>
140 </li>
141
142 <li> <a href="apache_hbase_reference_guide.pdf" target="_blank" title="Reference Guide (PDF)">Reference Guide (PDF)</a>
143 </li>
144
145 <li> <a href="book.html#quickstart" target="_blank" title="Getting Started">Getting Started</a>
146 </li>
147
148 <li> <a href="apidocs/index.html" target="_blank" title="User API">User API</a>
149 </li>
150
151 <li> <a href="testapidocs/index.html" target="_blank" title="User API (Test)">User API (Test)</a>
152 </li>
153
154 <li> <a href="devapidocs/index.html" target="_blank" title="Developer API">Developer API</a>
155 </li>
156
157 <li> <a href="testdevapidocs/index.html" target="_blank" title="Developer API (Test)">Developer API (Test)</a>
158 </li>
159
160 <li> <a href="http://abloz.com/hbase/book.html" target="_blank" title="中文参考指南(单页)">中文参考指南(单页)</a>
161 </li>
162
163 <li> <a href="book.html#faq" target="_blank" title="FAQ">FAQ</a>
164 </li>
165
166 <li> <a href="book.html#other.info" target="_blank" title="Videos/Presentations">Videos/Presentations</a>
167 </li>
168
169 <li> <a href="http://wiki.apache.org/hadoop/Hbase" target="_blank" title="Wiki">Wiki</a>
170 </li>
171
172 <li> <a href="acid-semantics.html" target="_blank" title="ACID Semantics">ACID Semantics</a>
173 </li>
174
175 <li> <a href="book.html#arch.bulk.load" target="_blank" title="Bulk Loads">Bulk Loads</a>
176 </li>
177
178 <li> <a href="metrics.html" target="_blank" title="Metrics">Metrics</a>
179 </li>
180
181 <li> <a href="cygwin.html" target="_blank" title="HBase on Windows">HBase on Windows</a>
182 </li>
183
184 <li> <a href="book.html#replication" target="_blank" title="Cluster replication">Cluster replication</a>
185 </li>
186
187 <li class="dropdown-submenu">
188 <a href="" title="1.2 Documentation">1.2 Documentation</a>
189 <ul class="dropdown-menu">
190 <li> <a href="1.2/apidocs/index.html" target="_blank" title="API">API</a>
191 </li>
192 <li> <a href="1.2/xref/index.html" target="_blank" title="X-Ref">X-Ref</a>
193 </li>
194 <li> <a href="1.2/book.html" target="_blank" title="Ref Guide (single-page)">Ref Guide (single-page)</a>
195 </li>
196 </ul>
197 </li>
198 </ul>
199 </li>
200 <li class="dropdown">
201 <a href="#" class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a>
202 <ul class="dropdown-menu">
203
204 <li> <a href="http://www.apache.org/foundation/" target="_blank" title="Apache Software Foundation">Apache Software Foundation</a>
205 </li>
206
207 <li> <a href="http://www.apache.org/foundation/how-it-works.html" target="_blank" title="How Apache Works">How Apache Works</a>
208 </li>
209
210 <li> <a href="http://www.apache.org/foundation/sponsorship.html" target="_blank" title="Sponsoring Apache">Sponsoring Apache</a>
211 </li>
212 </ul>
213 </li>
214 </ul>
215
216 <div id="search-form" class="navbar-search pull-right">
217 <script type="text/javascript">
218 var cx = '000385458301414556862:sq1bb0xugjg';
219
220 (function() {
221 var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
222 gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx;
223 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
224 })();
225
226 </script>
227 <gcse:search></gcse:search>
228 </div>
229
230
231
232 </div>
233
234 </div>
235 </div>
236 </div>
237
238 <div class="container">
239 <div id="banner">
240 <div class="pull-left">
241 <a href="./" id="bannerLeft">
242 <img src="" alt=""/>
243 </a>
244 </div>
245 <div class="pull-right"> <a href="./" id="bannerRight">
246 <img src="images/hbase_logo_with_orca_large.png" alt="Apache HBase"/>
247 </a>
248 </div>
249 <div class="clear"><hr/></div>
250 </div>
251
252 <div id="breadcrumbs">
253 <ul class="breadcrumb">
254
255
256
257
258
259
260 </ul>
261 </div>
262
263
264
265 <div id="bodyColumn" >
266
267 <!-- Licensed to the Apache Software Foundation (ASF) under one
268 or more contributor license agreements. See the NOTICE file
269 distributed with this work for additional information
270 regarding copyright ownership. The ASF licenses this file
271 to you under the Apache License, Version 2.0 (the
272 "License"); you may not use this file except in compliance
273 with the License. You may obtain a copy of the License at
274
275 http://www.apache.org/licenses/LICENSE-2.0
276
277 Unless required by applicable law or agreed to in writing,
278 software distributed under the License is distributed on an
279 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
280 KIND, either express or implied. See the License for the
281 specific language governing permissions and limitations
282 under the License. -->
283
284 <div class="section">
285 <h2><a name="Introduction"></a>Introduction</h2>
286
287 <p>
288 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>.
289 </p>
290 </div>
291
292 <div class="section">
293 <h2><a name="Setup"></a>Setup</h2>
294
295 <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>.
296 If you are using ganglia, the <a class="externalLink" href="http://wiki.apache.org/hadoop/GangliaMetrics">GangliaMetrics</a>
297 wiki page is useful read.</p>
298
299 <p>To have HBase emit metrics, edit <tt>$HBASE_HOME/conf/hadoop-metrics.properties</tt>
300 and enable metric 'contexts' per plugin. As of this writing, hadoop supports
301 <b>file</b> and <b>ganglia</b> plugins.
302 Yes, the hbase metrics files is named hadoop-metrics rather than
303 <i>hbase-metrics</i> because currently at least the hadoop metrics system has the
304 properties filename hardcoded. Per metrics <i>context</i>,
305 comment out the NullContext and enable one or more plugins instead.
306 </p>
307
308 <p>
309 If you enable the <i>hbase</i> context, on regionservers you'll see total requests since last
310 metric emission, count of regions and storefiles as well as a count of memstore size.
311 On the master, you'll see a count of the cluster's requests.
312 </p>
313
314 <p>
315 Enabling the <i>rpc</i> context is good if you are interested in seeing
316 metrics on each hbase rpc method invocation (counts and time taken).
317 </p>
318
319 <p>
320 The <i>jvm</i> context is
321 useful for long-term stats on running hbase jvms -- memory used, thread counts, etc.
322 As of this writing, if more than one jvm is running emitting metrics, at least
323 in ganglia, the stats are aggregated rather than reported per instance.
324 </p>
325 </div>
326
327
328 <div class="section">
329 <h2><a name="Using_with_JMX"></a>Using with JMX</h2>
330
331 <p>
332 In addition to the standard output contexts supported by the Hadoop
333 metrics package, you can also export HBase metrics via Java Management
334 Extensions (JMX). This will allow viewing HBase stats in JConsole or
335 any other JMX client.
336 </p>
337
338 <div class="section">
339 <h2><a name="Enable_HBase_stats_collection"></a>Enable HBase stats collection</h2>
340
341 <p>
342 To enable JMX support in HBase, first edit
343 <tt>$HBASE_HOME/conf/hadoop-metrics.properties</tt> to support
344 metrics refreshing. (If you've running 0.94.1 and above, or have already configured
345 <tt>hadoop-metrics.properties</tt> for another output context,
346 you can skip this step).
347 </p>
348
349 <div class="source"><pre class="prettyprint">
350 # Configuration of the &quot;hbase&quot; context for null
351 hbase.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
352 hbase.period=60
353
354 # Configuration of the &quot;jvm&quot; context for null
355 jvm.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
356 jvm.period=60
357
358 # Configuration of the &quot;rpc&quot; context for null
359 rpc.class=org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
360 rpc.period=60
361 </pre></div>
362 </div>
363
364 <div class="section">
365 <h2><a name="Setup_JMX_remote_access"></a>Setup JMX remote access</h2>
366
367 <p>
368 For remote access, you will need to configure JMX remote passwords
369 and access profiles. Create the files:
370 </p>
371
372 <dl>
373
374 <dt><tt>$HBASE_HOME/conf/jmxremote.passwd</tt> (set permissions
375 to 600)</dt>
376
377 <dd>
378
379 <div class="source"><pre class="prettyprint">
380 monitorRole monitorpass
381 controlRole controlpass
382 </pre></div>
383 </dd>
384
385
386 <dt><tt>$HBASE_HOME/conf/jmxremote.access</tt></dt>
387
388 <dd>
389
390 <div class="source"><pre class="prettyprint">
391 monitorRole readonly
392 controlRole readwrite
393 </pre></div>
394 </dd>
395 </dl>
396 </div>
397
398 <div class="section">
399 <h2><a name="Configure_JMX_in_HBase_startup"></a>Configure JMX in HBase startup</h2>
400
401 <p>
402 Finally, edit the <tt>$HBASE_HOME/conf/hbase-env.sh</tt>
403 script to add JMX support:
404 </p>
405
406 <dl>
407
408 <dt><tt>$HBASE_HOME/conf/hbase-env.sh</tt></dt>
409
410 <dd>
411
412 <p>Add the lines:</p>
413
414 <div class="source"><pre class="prettyprint">
415 HBASE_JMX_OPTS=&quot;-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false&quot;
416 HBASE_JMX_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.password.file=$HBASE_HOME/conf/jmxremote.passwd&quot;
417 HBASE_JMX_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.access.file=$HBASE_HOME/conf/jmxremote.access&quot;
418
419 export HBASE_MASTER_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.port=10101&quot;
420 export HBASE_REGIONSERVER_OPTS=&quot;$HBASE_JMX_OPTS -Dcom.sun.management.jmxremote.port=10102&quot;
421 </pre></div>
422 </dd>
423 </dl>
424
425 <p>
426 After restarting the processes you want to monitor, you should now be
427 able to run JConsole (included with the JDK since JDK 5.0) to view
428 the statistics via JMX. HBase MBeans are exported under the
429 <b><tt>hadoop</tt></b> domain in JMX.
430 </p>
431 </div>
432
433 <div class="section">
434 <h2><a name="Understanding_HBase_Metrics"></a>Understanding HBase Metrics</h2>
435
436 <p>
437 For more information on understanding HBase metrics, see the <a href="book.html#hbase_metrics">metrics section</a> in the Apache HBase Reference Guide.
438 </p>
439 </div>
440 </div>
441
442
443 </div>
444 </div>
445
446 <hr/>
447
448 <footer>
449 <div class="container">
450 <div class="row">
451 <p >Copyright &copy; 2007&#x2013;2018
452 <a href="https://www.apache.org/">The Apache Software Foundation</a>.
453 All rights reserved.
454
455 <li id="publishDate" class="pull-right">Last Published: 2018-03-11</li>
456 </p>
457 </div>
458
459 <p id="poweredBy" class="pull-right">
460 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
461 <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
462 </a>
463 </p>
464
465 </div>
466 </footer>
467 </body>
468 </html>