Friday, 19 June 2015

Steps to Install and Configure HBase on Apache Hadoop Cluster 2.0

HBase is one of the NOSQL Database which stores data in the form of column oriented key value pairs. Through HBase, we can perform real time data analytic. HFile or Map file is the data storage architecture for HBase.

Let us see the steps to install and configure HBase. Hadoop components should have installed and configured prior to HBase setup.

Step:1 [Download and extract the Hbase stable version]

>> tar -zxvf hbase-

Shift to super user mode and move the HBase folder to /usr/lib as shown below.

>> su
>> mv hbase-* Hbase/

Step:2 [Configure]

Set the JAVA_HOME environment variable here.

>> cd /usr/lib/Hbase/conf
>> gedit

export JAVA_HOME=/usr/lib/jvm/java-1.7.0

Step:3 [Configure hbase-site.xml]

>> cd /usr/lib/Hbase/conf
>> gedit hbase-site.xml

   //Here we have to set the path where we want HBase to store its files.
   //Here we have to set the path where we want HBase to store its built in zookeeper  files.

   //It will mention in which mode HBase should be run

   //HDFS instance address, using the hdfs:// URI syntax. We are running HDFS on the localhost at port 8030

Step:4 [Setting up Java Environment]

HBase also provides JAVA API libraries in order to manage the HBase table from application. So we need to set the classpath for HBase libraries (lib folder in HBase) as shown below.

>> gedit ~/.bashrc

export CLASSPATH = $CLASSPATH://home/hadoop/hbase/lib/*

Step:5 [Start hbase services and verify the status]

Start HBase as below

>> cd /usr/lib/Hbase
>> .bin/

Start Hbase Master Server as below.

>> .bin/ start 2
  • Number signifies specific server
  • Using the "" we can start up to 10 servers 
  • ./bin/ 2 4
  • To kill a backup master, we need its process id, which will be stored in a file named "/tmp/"
  • Below command to kill the backup master
>> cat /tmp/ |xargs kill -9

Start Region Server as below

>> .bin/ start 3

Start HBase shell as below.

>> cd bin
>>./hbase shell

To access Hbase web interface