Part-6 Installing HBase

In this article I will show you how to install HBase. I assume you have followed previous articles on how to install HDFS single node cluster. At minimum you need any HDP Platform (HDFS) running on your server.

Download HBase tar.gz file from below official site

cd ~/Downloads

Extract .tar.gz file

tar -zxvf hbase-1.2.6-bin.tar.gz

Create directory for HBase home.

mkdir -p /usr/lib/hbase

Move extracted folder to this directory

mv hbase-1.2.6 /usr/lib/hbase/

Edit Hbase configuration file

cd /usr/lib/hbase/hbase-1.2.6/conf
vi hbase-site.xml

Add below configurations. Adjust hbase.rootdir value as per your hadoop installation.


Edit file


Set JAVA_HOME path inside For example add below line in this file. Adjust path as per your Java installation directory.

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

Make executable

chmod +x

Add HBASE_HOME variable in ~/.bashrc

vi ~/.bashrc

Add below line

export HBASE_HOME=/usr/lib/hbase/hbase-1.2.6

Reload environment variables

source ~/.bashrc

Start HBase Server


Installation complete. Now test hbase through shell

$HBASE_HOME/bin/hbase shell

It should give you hbase shell like below

HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017

Try few commands like ‘list’ and ‘create’

hbase(main):001:0> list
0 row(s) in 0.1120 seconds
=> ["test"]

Create a table named test with a single column family named cf. Verify its creation by listing all tables and then insert some values.

hbase(main):003:0> create 'test', 'cf'
0 row(s) in 1.2200 seconds
hbase(main):003:0> list 'test'
1 row(s) in 0.0550 seconds
hbase(main):004:0> put 'test', 'row1', 'cf:a', 'value1'
0 row(s) in 0.0560 seconds
hbase(main):005:0> put 'test', 'row2', 'cf:b', 'value2'
0 row(s) in 0.0370 seconds
hbase(main):006:0> put 'test', 'row3', 'cf:c', 'value3'
0 row(s) in 0.0450 seconds

Above we inserted 3 values, one at a time. The first insert is at row1, column cf:a with a value of value1. Columns in HBase are comprised of a column family prefix — cf in this example — followed by a colon and then a column qualifier suffix (a in this case).

Verify the data insert by running a scan of the table as follows

hbase(main):007:0> scan 'test'
row1       column=cf:a, timestamp=1288380727188, value=value1
row2       column=cf:b, timestamp=1288380738440, value=value2
row3       column=cf:c, timestamp=1288380747365, value=value3
3 row(s) in 0.0590 seconds

For easy start/stop of Hbase service you can edit our standard and to add below commands.

vi ~/

add below line,

vi ~/

add below line