• No products in the cart.

HBase Installation

 

For the installation of HBase, Hadoop should be installed and it should be running. On this system, hduser is the hadoop user. Let us follow the following below steps to install HBase.

Step 1: Start Hadoop

Open the terminal and run the following commands. Here, hduser is the hadoop user. On your system hadoop user might be different.

    $ su - hduser
    Password:
    
    $ start-dfs.sh
    $ start-yarn.sh
    $ jps

If you get the output as shown in the image given below, then it means hadoop is started on your system.

If output is not coming as the above image, then go through HADOOP installation tutorial again.

Step2: Download HBase

Download the required stable release of HBase from the official [website](http://www-us.apache.org/dist/hbase/stable/) and save the file like the image given below:

Step 3: Unzip and Move

The below command is used to explore your root-user’s download directory. You need to put your root-user’s name at the place of “user” in the command given below:

    $ cd /home/user/Downloads
    $ sudo tar -zxvf hbase-1.2.4-bin.tar.gz
    $ sudo mv hbase-1.2.4 /usr/local/hbase

You can take help from the image given below. In this image, gopal is the root user on this system.

Step 4: Edit hbase-env.sh and hbase-site.xml

    $ cd /usr/local/hbase/conf

In the hbase-env.sh file, you need to export JAVA_HOME path. Here, you need to check the JAVA_HOME path on your system. You can display your java home using the command given below: `{} $ echo $JAVA_HOME

On this system the above command gives the output /usr/lib/jvm/java-7-openjdk-amd64

To update the hbase-env.sh, we need to run the command given below:

    $ sudo nano hbase-env.sh

Copy and paste the below line in the hbase-env.sh file

    export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
    export HBASE_REGIONSERVERS=/usr/local/hbase/conf/regionservers
    export HBASE_MANAGES_ZK=true

Use Ctrl+X and Y to save.

Your hbase-env.sh file will look like the image given below:

Now update the .bashrc file to export hbase variables:

    $ sudo nano ~/.bashrc

Copy and paste the below lines at the end of .bashrc:

    #HBASE VARIABLES START
    export HBASE_HOME=/usr/local/hbase
    export PATH=$PATH:$HBASE_HOME/bin
    #HBASE VARIABLES END

Image below explains how to append the HBASE variables:

Use Ctrl+X and Y to save.

To make the above changes permanent in .bashrc, we need to run the command given below:

    $ source ~/.bashrc

Now to update the hbase-site.xml file, use the command given below:

    $ cd /usr/local/hbase/conf
    $ sudo nano hbase-site.xml

Add the following lines between configuration tags:

    <configuration>
            <property>
                <name>hbase.rootdir</name>
                <value>hdfs://localhost:54310/hbase</value>
            </property>
            <property>
                    <name>hbase.zookeeper.property.dataDir</name>
                    <value>/usr/local/hadoop/zookeeper</value>
            </property>
            <property>
                <name>hbase.cluster.distributed</name>
                <value>true</value>
            </property>
    </configuration>

Use Ctrl+X and Y to save

Your hbase-site.xml file will look like the image given below:

Step 5: Starting HBASE

    $ cd /usr/local/hbase/bin
    $ sudo chown -R hduser:hadoop /usr/local/hbase/
    $ ./start-hbase.sh

You will get the following message which looks as shown in the image given below at the time of starting:

Once you need to run jps command to check the hbase daemons: {} $ jps

You will get the output as shown in the image given below:

To check the HBase Directory in HDFS:

    $ hadoop fs -ls hdfs://localhost:54310/hbase/

You will get the output as shown in the image given below:

Step 6: Starting hbase shell

    $ cd /usr/local/hbase/bin
    $ sudo ./local-master-backup.sh start 2
    $ sudo ./local-regionservers.sh start 2
    $ sudo ./hbase shell

The hbase shell will start as shown in the image given below:

Ctrl+C for quitting from the HBase.

To see the interface on web, go to browser and paste the below in URL:

    http://localhost:16010

Statinfer

Statinfer derived from Statistical inference. We provide training in various Data Analytics and Data Science courses and assist candidates in securing placements.

Contact Us

info@statinfer.com

+91- 9676098897

+91- 9494762485

 

Our Social Links

top
© 2020. All Rights Reserved.