hadoop – get “ERROR: Can’t get master address from ZooKeeper; znode data == null” when using Hbase shell – Stack Overflow

I installed Hadoop2.2.0 and Hbase0.98.0 and here is what I do :

<code><span class="pln">$ </span><span class="pun">./</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">start</span><span class="pun">-</span><span class="pln">hbase</span><span class="pun">.</span><span class="pln">sh </span></code>

$ ./bin/hbase shell

2.0.0p353 :001 > list

then I got this:

<code><span class="pln">ERROR</span><span class="pun">:</span> <span class="typ">Can</span><span class="str">'t get master address from ZooKeeper; znode data == null</span></code>

Why am I getting this error ? Another question:

do I need to run ./sbin/start-dfs.sh and ./sbin/start-yarn.sh before I run base ?

Also, what are used ./sbin/start-dfs.sh and ./sbin/start-yarn.sh for ?

Here is some of my conf doc :

hbase-sites.xml

<code><span class="pun">&lt;</span><span class="pln">configuration</span><span class="pun">&gt;</span></code>

<property>

<name>hbase.rootdir</name>

<value>hdfs://127.0.0.1:9000/hbase</value>

</property>

<property>

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

<value>true</value>

</property>

<property>

<name>hbase.tmp.dir</name>

<value>/Users/apple/Documents/tools/hbasetmpdir/hbasedata</value>

</property>

<property>

<name>hbase.zookeeper.quorum</name>

<value>localhost</value>

</property>

<property>

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

<value>/Users/apple/Documents/tools/hbasezookeeper/zookeeper</value>

</property>

</configuration>

core-sites.xml

<code><span class="pun">&lt;</span><span class="pln">configuration</span><span class="pun">&gt;</span></code>

<property>

<name>fs.defaultFS</name>

<value>hdfs://localhost:9000</value>

<description>The name of the default file system.</description>

</property>

<property>

<name>hadoop.tmp.dir</name>

<value>/Users/micmiu/tmp/hadoop</value>

<description>A base for other temporary directories.</description>

</property>

<property>

<name>io.native.lib.available</name>

<value>false</value>

</property>

</configuration>

yarn-sites.xml

<code><span class="pun">&lt;</span><span class="pln">configuration</span><span class="pun">&gt;</span></code>

<property>

<name>yarn.nodemanager.auxservices</name>

<value>mapreduce_shuffle</value>

</property>

<property>

<name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</name>

<value>org.apache.hadoop.mapred.ShuffleHandler</value>

</property>

</configuration>

 

share|improve this question

 

2 Answers

2

active

oldest

votes

up vote

2

down vote

accepted

If you just want to run hbase without going into zookeeper management for standalone Hbase, then remove the all the property blocks from hbase-site.xml except the property block with hbase.rootdir as name.
Now run /bin/start-hbase.sh.
Hbase comes with its own zookeeper , which gets started when you run /bin/start-hbase.sh, which will suffice if you are trying to get around things for the first time. Later you can put distributed mode configurations for zookeeper.

You only need to run /sbin/start-dfs.sh for running hbase since value of hbase.rootdir is set to hdfs://127.0.0.1:9000/hbase in you hbase-site.xml. If you change it to some location on local filesystem using file:///some_location_on_local_filesystem, then you don’t even need to run /sbin/start-dfs.sh.
hdfs://127.0.0.1:9000/hbase says its a place on hdfs and /sbin/start-dfs.sh starts namenode and datanode which provides underlying API to access the hdfs file system. For knowing about yarn , please look at http://hadoop.apache.org/docs/r2.3.0/hadoop-yarn/hadoop-yarn-site/YARN.html.

share|improve this answer

thanks for your patient answer which is really helpful to me, and I was also wondering if I want to connect Hbase with java api and do some ‘CRUD’ operation in java code locally, can standalone mode satisfy my requirement? How could I do that? I have already have some code here but just don’t know how to configure. I google it but seems no example online.

Rickie Lau

Mar 27 ’14 at 1:54

 

Can you put your code here so that I can see if there is anything wrong? Or better make a new question ,where i could give you code feedback.

Chandra kant

Mar 27 ’14 at 2:45

thanks again, and here is the new question where I attach my code : stackoverflow.com/questions/22680433/…

Rickie Lau

Mar 27 ’14 at 7:01

 

up vote

1

down vote

You need to start zookeeper and then run Hbase-shell

<code><span class="pun">{</span><span class="pln">HBASE_HOME</span><span class="pun">}/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">hbase</span><span class="pun">-</span><span class="pln">daemons</span><span class="pun">.</span><span class="pln">sh </span><span class="pun">{</span><span class="pln">start</span><span class="pun">,</span><span class="pln">stop</span><span class="pun">}</span><span class="pln"> zookeeper</span></code>

and you may want to check this property in hbase-env.sh

<code><span class="com"># Tell HBase whether it should manage its own instance of Zookeeper or not.</span></code>

export HBASE_MANAGES_ZK=false

Refer to Source – Zookeeper

来源URL:http://stackoverflow.com/questions/22663484/get-error-cant-get-master-address-from-zookeeper-znode-data-null-when-us