Created 12-09-2015 07:15 PM
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?
Created 12-09-2015 08:07 PM
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.
Created 12-09-2015 07:22 PM
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.
Created 12-09-2015 07:47 PM
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.
Created 12-09-2015 08:07 PM
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.
Created 12-10-2015 06:04 PM
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!
Created 11-21-2017 10:58 AM
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?