How easy to setup HBase Fully-distributed

HBase is a NoSQL under Hadoop.

Environment

  • Three installed jdk’s linux server.
    Startup the ntpd service already.
    Demo HBase server ip was 192.168.200.1, 192.168.200.2, 192.168.200.3.
    Used existing HDFS server ip was 192.168.100.1.
    Used existing Zookeeper server ip was 192.168.100.2.
  • Download HBase 1.2.x from hbase.apache.org
  • Extract Hbase’s package file to /opt and create a symlink name with /opt/hbase
  • Always in /opt/hbase for working

Configuration

Master (192.168.200.1)

  • Modify file conf/hbase-site.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://192.168.100.1:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>192.168.100.2</value>
</property>
<property>
<name>hbase.zookeeper.clientPort</name>
<value>2181</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase</value>
</property>
<property>
<name>hbase.master.hostname</name>
<value>192.168.200.1</value>
</property>
</configuration>

hbase.master.hostname set real ip address with itself, don’t try the hostname.

RegionServer (192.168.200.2/3)

  • Modify file conf/hbase-site.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://192.168.100.1:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>192.168.100.2</value>
</property>
<property>
<name>hbase.zookeeper.clientPort</name>
<value>2181</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase</value>
</property>
<property>
<name>hbase.regionserver.hostname</name>
<value>192.168.200.2</value>
</property>
</configuration>

hbase.regionserver.hostname set real ip address with itself, don’t try the hostname.

More Configuration (conf/hbase-site.xml)

  • HBase files replication in HDFS
1
2
3
4
<property>
<name>dfs.replication</name>
<value>2</value>
</property>

Startup & Shutdown

Master

  • Start
1
./bin/hbase-daemon.sh start master
  • Stop
1
./bin/hbase-daemon.sh stop master

You can start more type servers, like: thrift, thrift2, rest, etc.

RegionServer

  • Start
1
./bin/hbase-daemon.sh start regionserver
  • Stop
1
./bin/hbase-daemon.sh stop regionserver

Web interface

Open http://192.168.200.1:16010 in web browser, enjoy it.

Phoenix Installed (If you need it)

Phoenix is a SQL wapper for HBase.

  • Download phoenix-[version]-bin.tar.gz from phoenix.apache.org
  • Extract phoenix-[version]-server.jar and Copy it to ‘/opt/hbase/lib’ directory in All HBase instance

Configuration

  • Modify file conf/hbase-site.xml
1
2
3
4
<property>
<name>hbase.table.sanity.checks</name>
<value>false</value>
</property>

Usage

  • Restart All HBase instance after installed.
  • How to connect it? Click here