Support Questions
Find answers, ask questions, and share your expertise

Enable HBase metrics for JMX

I am trying to enable HBase metrics out to the JMX following this: https://hbase.apache.org/metrics.html. At the stage "Enable HBase stats collection", I am to edit $HBASE_HOME/conf/hadoop-metrics.properties on just the master servers or all the region servers as well? same goes for the Setup JMX remote access. Am I to create them on just my masters or on all regions?

I appreciate any help!

1 ACCEPTED SOLUTION

Accepted Solutions

Even I can't seem to reply now in that chain.

So, I think that you will need to modify the $HBASE_HOME/conf/hadoop-metrics2-hbase.properties file on all the Region servers and the HBase Masters. And restart each of those services. Also, for the remote access JMX files, again you would need to add that on all the hosts where you want to do the monitoring and add reference to the JMX files in $HBASE_HOME/conf/hbase-env.sh files.

This might be a tedious process doing it on all the hosts, so you might want to use the links in the previous answer for doing it via Ambari Or else give this is a try if the number of servers are few.

Hope this helps.

View solution in original post

12 REPLIES 12

@Anthony Schuhl

What is the version of Hbase you are using. The Metrics system was redone in HBase 0.96 and there you might be required to edit the conf/hadoop-metrics2-hbase.properties file, as per:

http://mstanleyjones.github.io/hbase/reflow_update/book.html#_hbase_metrics

  • Also are you using Ambari? If yes then you don't need to modify config files on the hosts. Just select Hbase service, go to the Configs tab and add the properties over there. Once the property changes are done Ambari will ask to restart required services.
  • If you are not using Ambari, I think you would need to update the property files on different hosts and restart services as required.

So I attached a link to be more clear on what I was following, and I am currently using .98. So I want to setup the JMX for remote access, I do not see an ability to use Ambari to put those files on the server and I also do not see the ability to edit the metrics file on Ambari either.

New Contributor

Add the following to your "Advanced hbase-env" part of Hbase config in Ambari.

If you're using ambari:

export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=20015"
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=20016"

If you're not using Ambari add this manually to your hbase-env

Thank you for your response. So if you see here: https://hbase.apache.org/metrics.html I also want to enable the metrics for remote access. Do you know if i need to create the access files on each server?

Hi @Anthony Schuhl

For your case, please try to follow the below steps mentioned to enable HBase Metrics:

Hmm I don't think I need to enable all of those metrics to achieve what I am trying to do. I am just trying to get remote access for the metrics as detailed here: https://hbase.apache.org/metrics.html

To just configure metrics for a given region server, edit the conf/hadoop-metrics2-hbase.properties file and restart the region server for the changes to take effect. If you want to monitor the JMX metrics for each region server you would need to follow the similar steps on all hosts.

Where do you edit the conf/hadoop-metrics2-hbase.properties file on Ambari?

This will be a manual process, you would need to do it on the Region server host.