node /hbase is not in ZooKeeper

Datetime:2017-03-19 05:22:11         Topic: HBase  ZooKeeper          Share        Original >>
Here to See The Original Article!!!

When we try to execute the LIST or CREATE table command in HBASE, the error that pops up commonly is :

ERROR: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in ‘zookeeper.znode.parent’. There could be a mismatch with the one configured in the master.

This happens because the HBase is not able to correctly initiate the ZooKeeper instance, due to which the node /hbase (default node) is not registered by the HBase master in the Zookeeper and hence the error.

Below is the way to troubleshoot this error.

First of all stop the existing HBase process, which by default runs on port 2181.

# sudo kill -9 PID

After this try and start afresh the HBase.

# sudo ./start-hbase.sh

starting master, logging to /Users/Downloads/hbase-1.0.3/bin/../logs/hbase-root-master-HW993798.out

This is the location where logs are stored, need to go and have a look at this log. Log is as below:

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/tcssig/Downloads/hbase-1.0.3/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/usr/local/Cellar/hadoop/2.7.2/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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]

Could not start ZK at requested port of 2181. ZK was started at port: -1. Aborting as clients (e.g. shell) will not be able to find this ZK quorum.

Most common reason for the  above error to occur is the incorrect JAVA_HOME path. Even when the Java home is correctly configured, it gives the below error.

+======================================================================+

| Error: JAVA_HOME is not set                       |

+———————————————————————-+

| Please download the latest Sun JDK from the Sun Java web site |

|     > http://www.oracle.com/technetwork/java/javase/downloads         |

| |

| HBase requires Java 1.7 or later.                                     |

+======================================================================+

We need to make a change in the hbase-env.sh file.

Set the export JAVA_HOME variable equal to your system’s Java Home.

After this restart the HBase. If the zookeeper and all get correctly initiated, the log file output should be similar to shown below :

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/tcssig/Downloads/hbase-1.0.3/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/usr/local/Cellar/hadoop/2.7.2/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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]

Now just go to HBase shell and run the LIST command. It should run successfully and give output similar to below.

hbase(main):001:0> list

TABLE                                                                                                                                                             0 row(s) in 0.2660 seconds

…………………………………………








New