Tech Corner

Install HBase in a snap! A simple step-by-step guide

Shripati Bhat
.
Jul 20
.
3-4 mins

Table of contents

Automate your business at $5/day with Engati

REQUEST A DEMO
Install HBase instantly

We at Engati use HBase effectively to store a large amount of time-series data. It is a distributed database and extensively uses Zookeeper for synchronization, configuration management, in addition to the communication between its internal components and the clients. This quick guide will show you how to install HBase on your Mac in barely any time.

How to setup HBase?

The HBase setup process on your mac can be done in just 5 minutes  (presuming that you have good internet connectivity). These steps work for any Linux-based OS as well, as long as you don't use brew. You can use this setup, for example, to play around with some basic functionalities. You could also use it in your local to do some simple queries or proof of concepts.

There are a few pre-requisites for Hbase setup.

  • OneInstall Java 1.8.0
  • TwoFind the value of JAVA_HOME (just type /usr/libexec/java_home in your terminal)

The most critical aspect while setting up HBase is a file system. For instance, you can choose HDFS as a file system or your local file system. For this post, we will select our local file system as an example.

1

Install Zookeeper

Firstly we need a zookeeper. If you happen to have an existing zookeeper installed, you can skip this step. If you don't have it, we can now start by installing zookeeper (standalone mode). You can choose to install it using brew or download it from the zookeeper website.

brew install zookeeper

Or, refer to the link below:

https://zookeeper.apache.org/doc/r3.4.6/zookeeperStarted.html

Hbase installation should take approximately a minute, and then you can start zookeeper using the commands below. However, if you are installing brew for the first time or haven’t updated brew, this might take some time.

brew service start zookeeper

Or, 

sh zookeeper-3.4.6/bin/zkServer.sh start

2

Get the zookeeper data directory

Now that we have a zookeeper downloaded and installed, we need to look for the zoo.cfgdataDir file. Pick the value of the property that you want to use later. For instance, it looks something like this in my case. 

dataDir=/usr/local/var/run/zookeeper/data

3

Download HBase

Once we have the zookeeper set, you can move on to download HBase. You can download it from https://hbase.apache.org/downloads.html, and I’m downloading stable version v1.6.0. After you’ve completed the download, you can enter or double click on the download file in your Finder. Now we would need to make some edits to its configuration files.

4

Edit HBase Configurations

Firstly, we edit hbase-1.6.0/conf/hbase-env.sh. This file already has properties JAVA_HOME and HBASE_MANAGES_ZK that we need to edit to the required values. We should now set the following command, JAVA_HOME to the correct value on your machine and set HBASE_MANAGES_ZK to false.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Homeexport HBASE_MANAGES_ZK=false

Secondly, we edit hbase-1.6.0/conf/hbase-site.xml, from which we need to remove all existing lines and copy the below content into it. An important detail to note here is that the value for hbase.zookeeper.property.dataDir property is the one we picked from Step 2. 

Furthermore, if any of the properties here are incorrect, HBase won't start and hence we need to be careful in this step. Here if you note the value of hbase.rootdir is file:///tmp which indicates that we are using our local file system to store all data and files (as contrary to hdfs://localhost:9090).

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href=”configuration.xsl"?>
<configuration></configuration>
<property></property>
<name>hbase.rootdir</name>
<value>file:///tmp</value>

 

<property></property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/var/run/zookeeper/data</value>

 

<property></property>
<name>hbase.cluster.distributed</name>
<value>true</value>

 

<property></property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>

 

5

Start HBase

Now we have all the necessary setup, and so we can go on to start Hbase. But we need to make sure that Zookeeper has begun, and then we start Hbase using the below command.

sh hbase-1.6.0/bin/start-hbase.sh

Additionally, to check for any errors or if we want to check if it is started successfully or not, you can find all the logs at hbase-1.6.0/logs/ directory. You can now login to the HBase shell using the below command.

sh hbase-1.6.0/bin/hbase shell

That's a wrap

Installing Hbase on a Mac is an effortless process. Go ahead and try your hand at the HBase installation on your Mac.

Here's the next article on how does hbase scale!

3x your revenue with Chatbots and Live Chat
Schedule a demo

Shripati Bhat

Shripati is a Senior Director at Engati. He's a technical enthusiast, passionate about designing and building scalable software.

Shripati has a deeply ingrained customer-first ideology and is highly skilled in designing and developing Java/J2EE applications and BigData applications.

Close Icon
Request a Demo!
Get started on Engati with the help of a personalised demo.
Thanks for the information.
We will be shortly getting in touch with you.
Oops! something went wrong!
For any query reach out to us on contact@engati.com
Close Icon
Congratulations! Your demo is recorded.

Select an option on how Engati can help you.

I am looking for a conversational AI engagement solution for the web and other channels.

I would like for a conversational AI engagement solution for WhatsApp as the primary channel

I am an e-commerce store with Shopify. I am looking for a conversational AI engagement solution for my business

I am looking to partner with Engati to build conversational AI solutions for other businesses

continue
Finish
Close Icon
You're a step away from building your Al chatbot

How many customers do you expect to engage in a month?

Less Than 2000

2000-5000

More than 5000

Finish
Close Icon
Thanks for the information.

We will be shortly getting in touch with you.

Close Icon

Contact Us

Please fill in your details and we will contact you shortly.

Thanks for the information.
We will be shortly getting in touch with you.
Oops! Looks like there is a problem.
Never mind, drop us a mail at contact@engati.com