Search code examples
hbasehdfsdistributed-computing

Zookeeper not able to locate master node in hbase pseudo distributed mode


i want to run hbase in pseudo distributed mode, installation is from scratch.
step followed

  1. start HBase.
  2. Start HBase Master Server
  3. Start the region server a
  4. Start HBase Shell
  5. execute list

Hbase started normally so the hbase shell. When i checked zookeeper, master as well region all server were up. For any query on hbase shell prompt, i am getting this error.

Error - Can't get master address from ZooKeeper; znode data == null

code- configuration -
                hbase-site.xml 
                <configuration>
                   <property>
                      <name>hbase.cluster.distributed</name>
                      <value>true</value>
                   </property>
                   //Here you have to set the path where you want HBase to store its files.
                   <property>
                      <name>hbase.rootdir</name>
                      <value>hdfs://localhost:8030/hbase</value>
                   </property>
                   <property>
                      <name>hbase.zookeeper.property.dataDir</name>
                      <value>/home/hadoop/zookeeper</value>
                   </property>
                </configuration>

Above is my hbase-site.xml configuration.
Please help me to understand that what i am missing.


Solution

  • The following properties needs to be added to the hbase xml file in /hbase/conf folder:

    <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2222</value>
    <description>Property from ZooKeeper's config zoo.cfg.
    The port at which the clients will connect.
    </description>
    </property>
    <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/biadmin/my-local-hbase/zookeeper</value>
    </property>
    <property>
    <name>hbase.zookeeper.quorum</name>
    <value>bivm</value>
    </property>

    Also edit the hbase-env.sh file. Add the correct JAVA_HOME path and uncomment

    export HBASE_MANAGES_ZK=true

    This should resolve the above error!