HBase : Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

When accessing remote HBase database using HBase Client from Java Applications, there is a possibility of getting the following error:

"Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master."

This is because the configurations on HBase server could be non-default and which are not necessarily known to Client developer. For example in my case, 'zookeeper.znode.parent' was changed to /hbase/secure instead of default /hbase. Like this there could be more changes which makes is cumbersome for HBase Client to pass all the configurations. One easy solution to get around these is:
    Get the hbase-site.xml from the HBase Cluster and add it to your Java applications Classpath. Thats it. This way we don't have to do the Zookeeper Quorum settings also.

Sample Scala Client Code:

val conf = org.apache.hadoop.hbase.HBaseConfiguration.create()
// Instead of the following settings, pass hbase-site.xml in classpath 
// conf.set("hbase.zookeeper.quorum", hbaseHost)
// conf.set("hbase.zookeeper.property.clientPort", hbasePort)

HBaseAdmin.checkHBaseAvailable(conf);
log.debug("HBase found! with conf " + conf);

Comments

Popular posts from this blog

Spark Cluster Mode - Too many open files

Binary Data to Float using Spark SQL

HDFS filenames without rest of the file details