I am using HBASE 0.94.8 standalone mode in Ubuntu. Its working fine i am able to do every operations in Hbase-shell. But after i logged of my system its giving following err
Mine is working with sudo command
hbase/bin$sudo ./start-habase.sh
I've got almost the same error "ZooKeeper exists failed after 4 retries". It was caused by running ./start-hbase.sh without having permissions to connect to the port 2181. The solution turned out to be really simple:
sudo ./start-hbase.sh
I've used the same configuration of hbase-site.xml as it is in Nabeel Ahmed's post.
Issue:
Hbase error zookeeper exists failed after 3 retiries
clearly indicates that zookeeper quorum is not running - most probable cause can be some inconsistency with your zookeeper.quorum setting in conf/hbase-site.xml
, the minimal has to be:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/testuser/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/testuser/zookeeper</value>
</property>
</configuration>
In the next section it is succinctly mentioned why zookeeper is required and how can one verify if it's running.
An overview:
Pre-assuming from your text (standalone setup) - you're mixing things up. Zookeeper in simple words manages HBase, and is a must requirement.
By default HBase itself handles zookeeper setup, start-stop (though one can change) - to verify look into the file conf/hbase-evn.sh
(in your hbase directory) there must be a line:
export HBASE_MANAGES_ZK=true
Basically tells HBase whether it should manage its own instance of Zookeeper or not. In case it is set to false
, edit to true
.
Now for verification there's a helpful command (forget about the ps
and then grep
):
$ jps
the command will list all the java processes (HBase is itself a Java application) on the machine i.e. the probable output has to be (for a minimal standalone HBase setup):
62019 Jps
61098 HMaster
61233 HRegionServer
61003 HQuorumPeer
Don't just kill the HBase process, instead use the start-stop utility:
$ ./bin/stop-hbase.sh
make the neccessary changes and start it again:
$ ./bin/start-hbase.sh
P.S. I could have misinterpreted your question (completely), do let me know in the comments I'll get back to you again and get the solution right - for the upcoming SO visitors.
When you look into the log files you will find that zookeeper is unable to connect with a port. For example, 543210
. That simply means
you have previously installed Hadoop on your machine, so hbase tries to lookup the previous hadoop installation's zookeeper. Please rename your existing hadoop setup or remove completely hadoop from your system. (But note that zookeeper seems to leave things around even after a deletion.)
It looks like the issue is not related to hbase
or zookeeper
. It is a system setting issue.
I've got the same issue after my Mac OS X update.
It turned out that DNS settings were changed by the update. I saw that in hbase logs:
2017-06-09 11:40:18,454 ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:143)
[SKIP]
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2432)
Caused by: java.lang.NullPointerException
at org.apache.hadoop.net.DNS.reverseDns(DNS.java:92)
After removing DNS settings in hbase-site.xml
the issue dissipeared:
<!--property>
<name>hbase.zookeeper.dns.interface</name>
<value>lo0</value>
</property>
<property>
<name>hbase.regionserver.dns.interface</name>
<value>lo0</value>
</property>
<property>
<name>hbase.master.dns.interface</name>
<value>lo0</value>
</property-->
If its only starting zookeeper, this should help you. I hope you are aware that zookeeper should be up and running before we start hbase.