ZookeeperConnectionException in HBase Standalone mode
I'm using hbase-0.90.0. I'm running it in standalone mode. While trying to execut开发者_JAVA技巧e any commands from "hbase shell" it is giving me the following error.
hbase(main):003:0> status 'detailed'
ERROR: org.apache.hadoop.hbase.ZooKeeperConnectionException: org.apache.hadoop.hbase.ZooKeeperConnectionException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
I'm new to HBase. Can you please help me out with this problem?
Thanks in advance
For one reason or another your HBase Client is not talking to Zookeeper. I just had the same problem and the issue for me was that the hbase config (hbase-site.xml) had the wrong port for the zookeeper (The default is 2181 and someone had set it to 2182 incorrectly). The config for using zookeeper is at http://hbase.apache.org/book.html#zookeeper.
Also checking what hbase and zookeeper think their names are and what they actually are. A usual suspect is that the /etc/hosts file has some extra entries for localhost / 127.0.0.1. So make sure your localhost has only one line for localhost and put all the aliases for 127.0.0.1 on a single line in /etc/hosts
Sometimes having the ipv4 and ipv6 entries in localhost confuses things, so try commenting out all the ipv6 entries (the ones with colons ':' in the address.)
so i had the exact same problem and changing the /etc/hosts file did it for me. I changed it so that 'localhost' and my host name both pointed to '127.0.0.1'
see http://comments.gmane.org/gmane.comp.java.hadoop.hbase.user/19718 for more details.
I had the same issue when I first started up HBase standalone mode on my mac 10.9. I fixed several parameters, but not sure which one really works. Anyway, below is the place that I make changes:
sudo nano /etc/hosts
make sure only one localhost, and it is 127.0.0.1
Edit hbase-site.xml
<configuration> <property> <name>hbase.rootdir</name> <value>file:///usr/local/hbase</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>usr/local/zookeeper</value> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> </configuration>
Edit
hbase-env.sh
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home (Warning: this path is the Java 1.6 path, seems that Java 1.7 does not support HBase) export HBASE_OPTS="-Djava.security.krb5.realm= -Djava.security.krb5.kdc=" (fix realm issue)
And now you shall be good! Good Luck!
I faced same issue. To solve it i followed below steps.
- Edit hbase-env.sh
@rem The java implementation to use. Java 1.6 required.
@rem set JAVA_HOME=c:\apps\java
Edit hbase-site.xml
<configuration> <property> <name>hbase.rootdir</name> <!-- <value>hdfs://localhost:9000/hbase</value> --> <!-- <value>hdfs://192.168.203.130:9000/hbase</value> --> <value>/usr/local/hbase/hbase-0.98.5/hbase</value> <description> The directory shared by RegionServers. </description> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <!--<value>/tmp/zookeeper</value>--> <value>/usr/local/hbase/hbase-0.98.5/zookeeper</value> <!-- <value>/usr/local/zookeeper/zookeeper-3.4.6/export</value> --> <description> Property from ZooKeeper config zoo.cfg. The directory where the snapshot is stored. </description> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> </configuration>
open .bashrc set Hbase PATH Environmental variable
#HBASE HOME <br>
export HBASE_HOME=/usr/local/hbase/hbase-0.98.5
export PATH=$PATH:$HADOOP_HOME/bin:$JAVA_HOME/bin:$HADOOP_HOME/sbin:$HBASE_HOME/bin
- Execute .bashrc file
hduser@ubuntu:~$source ~/.bashrc
- Execute start-hbase.sh command in your terminal
hduser@ubuntu:~$ start-hbase.sh
hduser@ubuntu:~$ hbase shell
hduser@ubuntu:~$ list
Thanks
精彩评论