Thursday, October 10, 2013

Running Hbase with hadoop in standalone mode

Running Hbase with Hadoop  in standalone mode:

I guess the reader of this blog has already set hadoop in on his system and it is in running mode.

For a simple installation you need to follow these quick step.  


 1. If you are using latest version of hadoop use the download latest stable release of hbase .

Here I am using hadoop version 1.1.2 already in running state. I have downloaded latest stable release of hbase so as to work with hadoop.


 2. Configuring the java home path in hbase-env.sh

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


 3. Configure the region server in hbase-env.sh  

export HBASE_REGIONSERVERS=/opt/hbase/conf/regionservers


 4. Tell HBase whether it should manage it's own instance of Zookeeper or not.

   

export HBASE_MANAGES_ZK=true


 5.  configuration in hbase-site.xml


  

        hbase.rootdir

            hdfs://localhost2:9000/hbase

    

    

     hbase.master

            localhost2:60000

    



     

        dfs.replication

        1   

          hbase.zookeeper.property.clientPort

          2182

          Property from ZooKeeper's config zoo.cfg.

          The port at which the clients will connect.

          

        

    

          hbase.zookeeper.quorum

          localhost2

          Comma separated list of servers in the ZooKeeper Quorum.

          For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".

          By default this is set to localhost for local and pseudo-distributed modes

          of operation. For a fully-distributed setup, this should be set to a full

          list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh

          this is the list of servers which we will start/stop ZooKeeper on.

          

    

    

      hbase.zookeeper.property.dataDir

      /opt/zookeeper

      Property from ZooKeeper's config zoo.cfg.

      The directory where the snapshot is stored.

      

    

     

     hbase.tmp.dir

      /opt/hbase/temp

   

   




 5. change the required setting in host file using command $ sudo gedit /etc/hosts 


 127.0.0.1 localhost

[your-ip]  localhost2


 6 change the required setting in host file using command  $sudo gedit /etc/hostname


 localhost


 7.  Now copy following jars using below command:


 cp ${HADOOP_HOME}/hadoop-core-*.jar   ${HBASE_HOME}/lib/

cp ${HADOOP_HOME}/lib/commons-configuration-*.jar   ${HBASE_HOME}/lib/


 8. now start your hbase using command

$./bin/start-hbase.sh

8. start habse shell using command

 $./bin/hbase shell



Note :


if your master server do not start due to safe mode of dfs problem , try this on hadoop command line:


 hadoop dfsadmin -safemode leave



 For checking if your hbase is running properly, u need to access this URL 

http://[your-ip-add]:60010 or localhost:60010


 you will get below page:



 


Congratulations !!, your set up is ready.


 If you are still facing any  problem , you can leave your comment on this blog.