HBase Quickstart Guide Doesn't work. Master doesn't start
Autor: animeworld | Publicado: 2014-03-27T12:17:00-07:00





Hello folks,



I was trying to install HBase but I couldn't start it.

I was following this tutorial:

https://hbase.apache.org/book/quickstart.html



Flaws in the tutorial



It doesn't mention that:





Hadoop services should be running;
You need to export HBASE_HOME;
You need to export JAVA_HOME in conf/hbase-env.sh (update: actually it's mentioned there. Probably I missed it, or they updated after I read it)
The path to directory must not contain file:// in the beginning;
Must start start-hbase.sh as root.






It should be a "quick!!" start guide, but it was not for me. Ok, I'm a newbie ...



1) Hadoop services must be running



Hadoop services must be running before you start HBase. Maybe this is too obvious, but not for me (the newbie guy).



If you don't have Hadoop, follow this tutorial:

http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/&nbsp;



If you already have Hadoop installed and configured, then run it:

./haddop-directory/sbin/start-all.sh



2) export HBASE_HOME

eg:

export HBASE_HOME=/usr/local/hbase



export PATH=$PATH:$HBASE_HOME/bin





3) export JAVA_HOME in conf/hbase-env.sh

eg:

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/

 

4) The path to directory must not contain file:// in the beginning



If you want it to be /usr/local/hbase, don't do: file:///usr/local/hbase.

Here is my hbase-site.xml:



&lt;configuration&gt;

&nbsp; &nbsp; &lt;property&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;name&gt;hbase.rootdir&lt;/name&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt;/usr/local/hbase/data/hbase&lt;/value&gt;

&nbsp; &nbsp; &lt;/property&gt;

&nbsp; &nbsp; &lt;property&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;name&gt;hbase.zookeeper.property.dataDir&lt;/name&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt;/usr/local/hbase/data/zookeeper&lt;/value&gt;

&nbsp; &nbsp; &lt;/property&gt;

&lt;/configuration&gt;





5) Run as Root


UPDATE (2014-05-13): This problem was happening with version&nbsp;hbase-0.94. I downloaded version&nbsp;hbase-0.98.2, and it's not necessary to start as root. Other thing is that maybe it's not related to the version, and it was I that forgot to change the owner of all files&nbsp;recursively&nbsp;in HBase ...:
hduser:hbase$ sudo chown -R hduser *



I don't know why, but I was only able to start HBase running it as root:

hbase-home/bin$ sudo start-hbase.sh



I saw this tip to run as root here:

http://stackoverflow.com/questions/15826863/cant-get-hbase-stand-alone-mode-to-start



I also realized when reading the log, that the normal user running the script didn't have access to delete a file, so it was causing an IOException:

2014-03-27 14:38:55,215 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master

java.io.IOException: Could not delete zk base directory: /usr/local/hbase/data/zookeeper/zookeeper_0



Please folks, if I am missing something, or if I did something wrong or&nbsp;unnecessary, I would be very grateful if you could comment explaining the correct solution.



Please also give a comment if this post helped you.



Thank you.&nbsp;