Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

API to pull HBase data locality

Solved Go to solution
Highlighted

API to pull HBase data locality

New 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

Accepted Solutions

Re: API to pull HBase data locality

Super 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'

.

4 REPLIES 4

Re: API to pull HBase data locality

Super 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_...

Re: API to pull HBase data locality

New 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.

Re: API to pull HBase data locality

Super 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'

.

Re: API to pull HBase data locality

New 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.