Support Questions

Find answers, ask questions, and share your expertise

API to pull HBase data locality

avatar
Contributor

Hello Everyone,

Is there any API/CURL command to pull HBase data locality ? we can monitor or view data locality from Ambari without that is there any easy way to find data locality in HBase.

HBase version: 1.1.2.2.5.3.0-37

HDP version:2.5.3

Thanks.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Jalender

"percentFilesLocal" which is basically a Percent of store file data that can be read from the local DataNode, 0-100.

This is actually a Region Server Property hence you should be able to get that value by making the JMX call to individual RegionServer. Like following:

# curl -S  "http://region_1.example.com:16030/jmx?qry=Hadoop:service=HBase,name=RegionServer,sub=Server" | grep 'percentFilesLocal'
.
.
# curl -S  "http://region_2.example.com:16030/jmx?qry=Hadoop:service=HBase,name=RegionServer,sub=Server" | grep 'percentFilesLocal'

.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Jalender

Are you talking about the "Percent Files Local": Percentage of files served from the local DataNode for the RegionServer.
In that case you can use AMS Grafana/Metrics.

Ambari Metrics Grafana: Search for "Percent Files Local"

http://$GRAFANA_HOST:3000/dashboard/db/hbase-regionservers

Or by directly making the AMS API call:
http://$AMBARI_METRICS_COLLECTOR_HOST:6188/ws/v1/timeline/metrics/?metricNames=regionserver.Server.p...

Reference: https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.2/bk_ambari-operations/content/grafana_hbase_...

avatar
Contributor

@Jay Kumar SenSharma thanks for your response, i'm looking for "Average percentage of local files to Region server in the cluster". Is there any other way apart from Ambari and Grafana to pull directly from HBase because we don't use Ambari or Grafana, thanks.

avatar
Master Mentor

@Jalender

"percentFilesLocal" which is basically a Percent of store file data that can be read from the local DataNode, 0-100.

This is actually a Region Server Property hence you should be able to get that value by making the JMX call to individual RegionServer. Like following:

# curl -S  "http://region_1.example.com:16030/jmx?qry=Hadoop:service=HBase,name=RegionServer,sub=Server" | grep 'percentFilesLocal'
.
.
# curl -S  "http://region_2.example.com:16030/jmx?qry=Hadoop:service=HBase,name=RegionServer,sub=Server" | grep 'percentFilesLocal'

.

avatar
Contributor

@Jay Kumar SenSharma is there way we can get "Average percentage of local files to Region server in the cluster" for entire HBase cluster instead of querying by each region server , thanks.