ZookeeperConnectionException in HBase Standalone mode
I'm using hbase-0.90.0. I'm running it in standalone mode. While trying to execute 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!
链接地址: http://www.djcxy.com/p/50702.html