Skip to content

Setup HBase 1.2.4 in multi node cluster

karimiehsan90 edited this page Jul 21, 2019 · 12 revisions

Prerequisites

First go to /etc/hosts and define your nodes like this.

192.168.1.1 master
192.168.1.2 slave-1
192.168.1.3 slave-2

Install hadoop in all nodes like this documentation and make hbase directory in hadoop like this. hadoop fs -mkdir /hbase. Install zookeeper in at least master following this link.

Download

Download HBase from this link in master.

Untar downloaded file and copy to '/var/local/hbase'.

Add to environment variables

Edit the ~/.bashrc file and add this lines.

export HBASE_HOME=/var/local/hbase
export PATH=$PATH:$HBASE_HOME/bin

Resource it. source ~/.bashrc

Configure

Go to conf directory in HBASE_HOME and edit hbase-site.xml and add this lines in <configuration>.

<property>
    <name>hbase.rootdir</name>
    <value>hdfs://master:9000/hbase</value>
</property>

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

<property>
    <name>hbase.zookeeper.quorum</name>
    <value>master</value>
</property>

Then go to hbase-env.sh and do this. Change value of JAVA_HOME to your java home directory. Change HBASE_MANAGES_ZK to false. And if your ssh is on a port different from 22 add this:

export HBASE_SSH_OPTS="-p 2222"

Edit the regionservers file and add your slaves like this:

slave-1
slave-2

Propagate this changes in all slave servers with scp command. And then start hbase in master by start-hbase.sh.

Good lock. :)