22 C

How To Install HBase on Ubuntu 18.04

- Advertisement -
- Advertisement -

Today we will learn that how we can Install HBase on our Ubuntu 18.04 system. HBase has two modes.

  • Standalone Mode
  • Pseudo-Distributed Mode

Let’s move towards the Installation

Step 1: Download & Install HBase

Download the stable release of HBase for production use.

wget http://apache.mirror.gtcomm.net/hbase/stable/hbase-$VER-bin.tar.gz
- Advertisement -

Extract the downloaded archive.

tar xvf hbase-$VER-bin.tar.gz

Now, use the given command to move file to /usr/local/HBase/ directory.

sudo mv hbase-$VER/ /usr/local/HBase/

Update your $PATH value

cat <<EOF | sudo tee /etc/profile.d/hadoop_java.sh
export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac)))))
export HADOOP_HOME=/usr/local/hadoop
export HBASE_HOME=/usr/local/HBase

Update shell environment values.

$ source /etc/profile.d/hadoop_java.sh
$ echo $HBASE_HOME

Edit JAVA_HOME in shell script hbase-env.sh

$ sudo vim /usr/local/HBase/conf/hbase-env.sh
Set JAVA_HOME - Line 27
export JAVA_HOME=/usr/lib/jvm/java-8-oracle

Step 2: Configure HBase

You can find out all config files of HBase under /usr/local/HBase/conf .

We will do the configurations like we did for Hadoop.


Set data directory to an appropriate location on this file

Option 1: Install HBase in Standalone Mode (Not Recommended)

All daemon will run in one jvm process so this is not recommended.

Make HBase root directory.

sudo mkdir -p /hadoop/HBase/HFiles
sudo mkdir -p /hadoop/zookeeper
sudo chown -R hadoop:hadoop /hadoop/

Edit the file.

sudo nano /usr/local/HBase/conf/hbase-site.xml

Do the same configuration



Unless you configure the hbase.rootdir property, your data is stored in /tmp/

Start HBase

$ sudo su - hadoop
$ start-hbase.sh
running master, logging to /usr/local/HBase/logs/hbase-hadoop-master-hbase.out

Option 2: Install HBase in Pseudo-Distributed Mode (Recommended)

Pseudo-Distributed mode runs only on single host but each HBase daemon runs as a separate process.

Set values of HBase according to below to Install it.




Your data will be stored in HDFS in this setup.
Create Zookeeper directory by typing

sudo mkdir -p /hadoop/zookeeper
sudo chown -R hadoop:hadoop /hadoop/

Start HBase by using start-hbase.sh script in HBase bin directory.

$ sudo su - hadoop
$ start-hbase.sh
localhost: running zookeeper, logging to /usr/local/HBase/bin/../logs/hbase-hadoop-zookeeper-hbase.out
running master, logging to /usr/local/HBase/logs/hbase-hadoop-master-hbase.out
: running regionserver, logging to /usr/local/HBase/logs/hbase-hadoop-regionserver-hbase.out

See the HBase Directory in HDFS

hadoop fs -ls /hbase

Step 3: Managing HMaster & HRegionServer

HRegion server stores the data into StoreFiles as directed by the HMaster while HMaster server controls the HBase cluster.
Both servers can be started & stopped using the scripts local-master-backup.sh and local-regionserver.sh respectively.

$ local-master-backup.sh start 2 # Start backup HMaster
$ local-regionservers.sh start 3 # Start multiple RegionServers

HMaster uses two ports (16000 and 16010 by default). Due to port offset, HMaster uses ports 16002 and 16012

Run the given command to start 3 backup servers using ports 16002/16012 , 16003/16013, 16005/16015

$ local-master-backup.sh start 2 3 5

RegionServer requires two ports, default ports are 16020 & 16030.

To start additional RegionServers, running on sequential ports starting at 16022/16032 (base ports 16020/16030 plus 2)

$ local-regionservers.sh start 2 3 4 5

In order to stop , just replace the start with stop parameter. e.g;

$ local-regionservers.sh stop 5

Step 4: Starting HBase Shell

Hadoop & HBase should be running before you can use HBase shell. Type the following to start services.


Then use HBase shell

hbase shell

Stopping HBase


See our tutorial: How To Install Hadoop on Ubuntu 18.04

Congratulations! You’ve finished installing HBase on Ubuntu 18.04. To learn more about Hadoop & HBase visit Apache Hadoop Documentation & Apache HBase book.


Please enter your comment!
Please enter your name here

Latest article