Support Questions

Find answers, ask questions, and share your expertise

zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts

avatar
Contributor

Hi I tried installing hbase manually i.e. steps mentioned below but the issue with me here is after i run hbase shell command i got following error messages. zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts.  Please Advise.

 

Note : Detail error messages is mentioned below

 

First Unzip hbase-1.2.6-bin.tar.gz by following command

 

[hduser@storage Downloads]$  tar zxvf hbase-1.2.6-bin.tar.gz

 

Second Once you unzip hbase-1.2.6-bin.tar.gz. It will create a folder as hbase-1.2.6. Move this folder  to /home/hduser.  After moving the folder verify the folder as following

 

 

Third Once you move the follow step two i.e. moving hbase folder . The third step that you need to do I create shortcut link and the command for shortcut link is following

[hduser@storage ~]$ ln -s  hbase-1.2.6 hbase

 

Fourth Edit Bash profile and add following statement

 

[hduser@storage ~]$ vi ~/.bash_profile

export HBASE_HOME=/home/hduser/hbase-1.2.6/

export PATH=$PATH:$HBASE_HOME/bin/

 

Fifth Go to cd /home/hduser/hbase-1.2.6/conf location and Edit hbase-site.xml and Add below mentioned blue color text and then save and exit

 

[hduser@storage conf]$ cd /home/hduser/hbase-1.2.6/conf

[hduser@storage conf]$ ls -al

total 52

drwxr-xr-x. 2 hduser hadoop 4096 Oct  4 13:45 .

drwxr-xr-x. 8 hduser hadoop 4096 Oct  4 13:44 ..

-rw-r--r--. 1 hduser hadoop 1811 Dec 27  2015 hadoop-metrics2-hbase.properties

-rw-r--r--. 1 hduser hadoop 4537 Jan 29  2016 hbase-env.cmd

-rw-r--r--. 1 hduser hadoop 7468 Jan 29  2016 hbase-env.sh

-rw-r--r--. 1 hduser hadoop 2257 Dec 27  2015 hbase-policy.xml

-rw-r--r--. 1 hduser hadoop 1225 Oct  4 13:45 hbase-site.xml

-rw-r--r--. 1 hduser hadoop 1214 Oct  4 13:40 hbase-site.xml~

-rw-r--r--. 1 hduser hadoop 4603 May 29 14:29 log4j.properties

-rw-r--r--. 1 hduser hadoop   10 Dec 27  2015 regionservers

[hduser@storage conf]$

 

<configuration>

<property>

<name>hbase.rootdir</name>

<value>hdfs://localhost:8020/hbase</value>

 

</property>

 

<property>

<name>hbase.cluster.distributed</name>

<value>false</value>

</property>

 

<property>

<name>hbase.zookeeper.property.dataDir</name>

<value>/home/hduser/spark/zoo_data</value>

</property>

</configuration>

 

Sixth Refresh bash_profile file using following command

 

[hduser@storage ~]$ . ~/.bash_profile

 

Seventh Start hbase

 

Note : Just in case if you see JAVA Related error while triggering start-hbase.sh command then you  need to follow following steps:-

 

  1. Find java home location

 [hduser@storage bin]$ echo $JAVA_HOME
/usr/local/jdk1.8.0_111
[hduser@storage bin]$

 

Copy this location /usr/local/jdk1.8.0_111

 

2. Edit hbase-env.sh file located at /home/hduser/hbase-1.2.6/conf folder

[hduser@storage conf]$ pwd

/home/hduser/hbase-1.2.6/conf

 

3. Under export JAVA_HOME , Paste this location -->/usr/local/jdk1.8.0_111 i.e. shown below

 

[hduser@storage conf]$ vi hbase-env.sh

And add following statement--->  export JAVA_HOME=/usr/local/jdk1.8.0_111

 

And then trigger start-hbase.sh again

 

Eight Start hbase in shell mode

 

Complete Error Message is shown below

 

[hduser@storage bin]$ stop-hbase.sh
stopping hbase................................................................................................................................................


[hduser@storage bin]$ start-hbase.sh
starting master, logging to /home/hduser/hbase-1.2.6//logs/hbase-hduser-master-storage.castrading.com.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0


[hduser@storage bin]$ hbase shell
2017-10-04 14:55:30,688 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hduser/hbase-1.2.6/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hduser/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
2017-10-04 14:55:48,556 ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts
2017-10-04 14:55:48,558 WARN  [main] zookeeper.ZKUtil: hconnection-0x46aa712c0x0, quorum=localhost:2181, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:220)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:419)
    at org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:65)
    at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:105)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.retrieveClusterId(ConnectionManager.java:905)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:648)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:218)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:450)
    at org.jruby.javasupport.JavaMethod.invokeStaticDirect(JavaMethod.java:362)
    at org.jruby.java.invokers.StaticMethodInvoker.call(StaticMethodInvoker.java:58)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at org.jruby.RubyClass.newInstance(RubyClass.java:822)
    at org.jruby.RubyClass$i$newInstance.call(RubyClass$i$newInstance.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:249)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
    at home.hduser.hbase_minus_1_dot_2_dot_6.bin.hirb.__file__(/home/hduser/hbase-1.2.6//bin/hirb.rb:131)
    at home.hduser.hbase_minus_1_dot_2_dot_6.bin.hirb.load(/home/hduser/hbase-1.2.6//bin/hirb.rb)
    at org.jruby.Ruby.runScript(Ruby.java:697)
    at org.jruby.Ruby.runScript(Ruby.java:690)
    at org.jruby.Ruby.runNormally(Ruby.java:597)
    at org.jruby.Ruby.runFromMain(Ruby.java:446)
    at org.jruby.Main.doRunFromMain(Main.java:369)
    at org.jruby.Main.internalRun(Main.java:258)
    at org.jruby.Main.run(Main.java:224)
    at org.jruby.Main.run(Main.java:208)
    at org.jruby.Main.main(Main.java:188)
2017-10-04 14:55:48,569 ERROR [main] zookeeper.ZooKeeperWatcher: hconnection-0x46aa712c0x0, quorum=localhost:2181, baseZNode=/hbase Received unexpected KeeperException, re-throwing exception
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:220)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:419)
    at org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:65)
    at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:105)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.retrieveClusterId(ConnectionManager.java:905)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:648)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:218)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:450)
    at org.jruby.javasupport.JavaMethod.invokeStaticDirect(JavaMethod.java:362)
    at org.jruby.java.invokers.StaticMethodInvoker.call(StaticMethodInvoker.java:58)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at org.jruby.RubyClass.newInstance(RubyClass.java:822)
    at org.jruby.RubyClass$i$newInstance.call(RubyClass$i$newInstance.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:249)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
    at home.hduser.hbase_minus_1_dot_2_dot_6.bin.hirb.__file__(/home/hduser/hbase-1.2.6//bin/hirb.rb:131)
    at home.hduser.hbase_minus_1_dot_2_dot_6.bin.hirb.load(/home/hduser/hbase-1.2.6//bin/hirb.rb)
    at org.jruby.Ruby.runScript(Ruby.java:697)
    at org.jruby.Ruby.runScript(Ruby.java:690)
    at org.jruby.Ruby.runNormally(Ruby.java:597)
    at org.jruby.Ruby.runFromMain(Ruby.java:446)
    at org.jruby.Main.doRunFromMain(Main.java:369)
    at org.jruby.Main.internalRun(Main.java:258)
    at org.jruby.Main.run(Main.java:224)
    at org.jruby.Main.run(Main.java:208)
    at org.jruby.Main.main(Main.java:188)
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017

hbase(main):001:0>  exit

 

 

3 REPLIES 3

avatar
New Contributor

Did you find a solution? I have the same problem and nothing seems to work 

 

Thanks

avatar
Mentor
Are you facing this in a CDH QuickStart VM, or in a Cloudera Manager installation of CDH?

For manual Apache HBase tarball setups, following the upstream guide to the dot would ensure you get a working environment.

Specifically for @UjjwalRana's issue, merely setting up HBase is inadequate. First setup ZK that HBase relies on, ensure it works (via zkCli.sh, or zookeeper-client commands) and then point HBase configuration to it.

avatar
Contributor

Hi Harsh,

 

Could you please help me how to check /hbase connection in zkcli