Can’t get connection to zookeeper: KeeperErrorCode = ConnectionLoss for HBase

A few days back when i was working on hbase to create a table, I just open the terminal and typed hbase shell(to get into hbase shell view).

Then I typed list(to list all tables). The HBase shell throwed me some error similar to the blog post description and the below image.

hbase zookeeper issue

I just checked some stackoverflow to get this issue fixed. Some said i might be the issue with Zookeeper Quorum, network issue, NAT problem.

I found the solution for this problem.

Open the hbase-site.xml from /dir/hbase-0.9x.x-hadoop2/conf

Just take a backup of the hbase-site.xml by using cp command(cp hbase-site.xml hbase-site.xml_backup).

Open the hbase-site.xml, add the below one’s in the xml file

<configuration>
 <property>
 <name>hbase.rootdir</name>
 <value>hdfs://localhost:8020/hbase</value>
 </property>

<property>
 <name>hbase.zookeeper.quorum</name>
 <value>localhost</value>
 </property>

<property>
 <name>hbase.zookeeper.property.clientPort</name>
 <value>2182</value>
 </property>

<property>
 <name>hbase.zookeeper.property.dataDir</name>
 <value>/var/lib/hbase/zookeeper</value>
 </property>

</configuration>

Save and close the file.

Open a new terminal and type hbase shell to get the shell. Type list to get the list of tables.

hbase-issue

Hope this helps.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s