Community Articles
Find and share helpful community-sourced technical articles
Labels (1)
Expert Contributor

While trying to connect to the HBase cluster from an edge node or a client HBase API we get the expection "Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations "


The exact stack that we encounter is as below:

log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See for more info. 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See for further details. 
Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations 
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations( 
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries( 
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner( 
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction( 
at org.apache.hadoop.hbase.client.ClientScanner.<init>( 
at org.apache.hadoop.hbase.client.HTable.getScanner( 
at org.apache.hadoop.hbase.client.MetaScanner.metaScan( 
at org.apache.hadoop.hbase.client.MetaScanner.metaScan( 
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isTableAvailable( 
at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable( 
at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable( 
at Table.main( 


This happens when user has an incorrect value defined for "zookeeper.znode.parent" in the hbase-site.xml sourced on the client side or in case of a custom API written , the "zookeeper.znode.parent" was incorrectly updated to a wrong location . For example the default "zookeeper.znode.parent" is set to "/hbase-unsecure" , but if you incorrectly specify that as lets say "/hbase" as opposed to what we have set up in the cluster, we will encounter this exception while trying to connect to the HBase cluster.


The solution here would be to update the hbase-site.xml / source out the same hbase-site.xml from the cluster or update the HBase API to correctly point out the "zookeeper.znode.parent" value as updated in the HBase cluster.


This is incorrect solution. If we have incorrect zookeeper.znode.parent = "/hbase" we will have exception like this: INFO ZooKeeper: Initiating client connection ... baseZNode=/hbase ...
ERROR ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

Current issue not solve problem with: ... RetriesExhaustedException: Can't get the locations

I believe this could be because of deprecated APIs if the cluster is upgraded. It is recommended that org.apache.hadoop.hbase.client.Connection should be used to connect with Hbase tables.

Connection object encapsulates lower level individual connections to actual servers and a connection to zookeeper.

Connections are instantiated through the org.apache.hadoop.hbase.client.ConnectionFactory class.

Don't have an account?
Version history
Revision #:
1 of 1
Last update:
‎12-28-2016 04:19 PM
Updated by:
Top Kudoed Authors