1
votes

I initiate the zookeeper, that says zookeeper server started but with the following feedback:

ZooKeeper JMX enabled by default
Using config: /home/saichanda/zookeeper-3.4.12/bin/../conf/zoo.cfg
mkdir: cannot create directory ‘’: No such file or directory
Starting zookeeper ... STARTED

then I start the hbase using

./bin/start-hbase.sh

output:

starting master, logging to /usr/local/hbase/bin/../logs/hbase-root-master-saichanda-OptiPlex-9020.out

then I give the command,

./bin/hbase shell

this opens the hbase shell but when I create a table in the shell, it throws the following

ERROR:

2018-07-28 11:19:07,563 ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts
2018-07-28 11:19:07,564 WARN  [main] zookeeper.ZKUtil: hconnection-0x10823d720x0, 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)

Do we need to have the location of zookeeper logs and hbase in the same directory?

I have got the error, even after setting

export HBASE_MANAGES_ZK=true

but, in the hbase-site.xml file, my path where I want hbase to store its built-in zookeeper files is different from hbase directory

Is that fine to have different addresses or they should be in the same directory?

How to resolve this error, to run hbase shell smoothly?

1

1 Answers

1
votes

Make sure you have specified following in hbase-site.xml with valid values. I am assuming this is non-HA setup since you have asked hbase to host its own Zk.

<property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>{absolute_path}</value>
</property>
<property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
</property>
<property>
    <name>hbase.zookeeper.quorum</name>
    <value>{hostname}</value>
</property>
<property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
</property>

After adding this re-start hbase process and see there are no errors in hbase logs. which can be found at ${hbase_home}/logs/