HBase is an open-source, distributed, versioned, column-oriented store modeled after Google ‘Bigtable’.
This tutorial will describe how to setup and run Hbase cluster, with not too much explanation about hbase. There are a number of articles where the Hbase are described in details.
We will build hbase cluster using three Ubuntu machine in this tutorial.
A distributed HBase depends on a running ZooKeeper cluster. All participating nodes and clients need to be able to get to the running ZooKeeper cluster. HBase by default manages a ZooKeeper cluster for you, or you can manage it on your own and point HBase to it. In our case, we are using default ZooKeeper cluster, which is manage by Hbase
Following are the capacities in which nodes may act in our cluster:
1. Hbase Master:- The HbaseMaster is responsible for assigning regions to HbaseRegionserver, monitors the health of each HbaseRegionserver.
2. Zookeeper: – For any distributed application, ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
3. Hbase Regionserver:- The HbaseRegionserver is responsible for handling client read and write requests. It communicates with the Hbasemaster to get a list of regions to serve and to tell the master that it is alive.
In our case, one machine in the cluster is designated as Hbase master and Zookeeper. The rest of machine in the cluster act as a Regionserver.
<description>The host and port that the HBase master runs at.
A value of ‘local’ runs the master and a regionserver
in a single process.
<description>The directory shared by region servers.</description>
<description>The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed
Zookeeper true: fully-distributed with unmanaged Zookeeper
Quorum (see hbase-env.sh)
<description>Property from ZooKeeper’s config zoo.cfg.
The port at which the clients will connect.
<description>Comma separated list of servers in the ZooKeeper Quorum.
For example, “host1.mydomain.com,host2.mydomain.com”.
By default this is set to localhost for local and
pseudo-distributed modes of operation. For a fully-distributed
setup, this should be set to a ful list of ZooKeeper quorum
servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
this is the list of servers which we will start/stop ZooKeeper on.
6. Open the file $HBASE_INSTALL_DIR/conf/hbase-env.sh and uncomment the following line:
Above steps is required on all the datanode in the hadoop cluster.
START AND STOP HBASE CLUSTER
1. Starting the Hbase Cluster:-
we have need to start the daemons only on the hbase-master machine, it will start the daemons in all regionserver machines. Execute the following command to start the hbase cluster.
At this point, the following Java processes should run on hbase-master machine.
and the following java processes should run on hbase-regionserver machine.
2. Starting the hbase shell:-
HBase Shell; enter ‘help<RETURN>’ for list of supported commands.