Support Questions

Find answers, ask questions, and share your expertise

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

avatar
Contributor

After default install, I can use Hbase shell to create tables. But when I tired to use Java API to do the same thing, I got the above mismatch issue. I found the default install seems not setup zookeeper's myid file in Habase master node. there is no znode called '/hbase-unseure" in zookeeper znode folder. How to configure Hbase and Zookeepr and test if they are running well? It seems that HW default install does not make ZK and Hbase configure automatically correct?

1 ACCEPTED SOLUTION

avatar
Guru

In HDP deployments, zookeeper is always started as a separate service (rather than HBase managing zookeeper). You can see whether zookeeper is running or not from Ambari or by manually looking at running processes. You can also use the zkCli command to connect to the running zookeeper to inspect its state.

However, as pointed out by Josh already, from an Java application talking to HBase, the correct way to configure is to add the hbase's configuration directory (/etc/hbase/conf) to your classpath. You can check https://community.hortonworks.com/articles/4091/hbase-client-application-best-practices.html.

View solution in original post

5 REPLIES 5

avatar
Super Guru

Instead of changing the default ZooKeeper node for HBase, you could (should) include /etc/hbase/conf/hbase-site.xml in the classpath of your application. This will help the HBase libraries find the correct location in ZooKeeper for your HBase instance.

avatar

The ZNode is automatically recreated by the HBase Master during startup, if it does not exist. There might be times where you run into a corrupted HBase Znode, in that case you have to basically shutdown hbase, remove the old ZNode, and restart HBase again.

Is your environment kerberized?

Could you please shutdown HBase, open the HBase master log and restart the hbase master. During startup monitor the log and look out for Errors and Zookeeper related entries.

avatar
Guru

In HDP deployments, zookeeper is always started as a separate service (rather than HBase managing zookeeper). You can see whether zookeeper is running or not from Ambari or by manually looking at running processes. You can also use the zkCli command to connect to the running zookeeper to inspect its state.

However, as pointed out by Josh already, from an Java application talking to HBase, the correct way to configure is to add the hbase's configuration directory (/etc/hbase/conf) to your classpath. You can check https://community.hortonworks.com/articles/4091/hbase-client-application-best-practices.html.

avatar
Contributor

Thanks for all your answers. I was tried to put /etc/hbase/conf/hbase-site.xml into $CLASSPATH or $PATH but not able to work out. However, when I put it into jar -cp directory. It works!

avatar
New Contributor

Hi All, I am new to this and I am facing the same error. I have checked hbase-site.xml (value of zookeeper.znode.parent is /hbase-unsecure) I have given it's path in the CLASSPATH (and even in PATH variables). My code is bundled in a jar and while running as well I tried giving the path using the -cp. I see no error logs either in HBase or in Zookeeper. Is there anything I need to check further?