Apache HBase is a distributed, scalable, bigdata store.Actually it is the Hadoop database.Apache HBase is the subproject of the Apache Hadoop project and is used to provide real-time read and write access to your bigdata.HBase runs on top of HDFS(Hadoop Distributed File System).
Before installing HBase, we have to install Hadoop and zookeeper.The zookeeper cluster act as a coordination service for entire HBase cluster.For Single node HBase installation, the zookeeper is installed and started automatically.
For HBase development, selecting Hadoop version is very critical. The Hadoop version should be compactable with HBase version. Here we are using HBase-0.94.x, HBase requires hadoop-1.0.3 at a minimum.
This section lists required services and some required system configuration.
- java JDK
As of now the recommended and tested versions of java for Hadoop and HBase installation include
Oracle jdk 1.6(u 20,21,26,28,31)
Hadoop requires java1.6+. It is built and tested on Oracle java, which is the only “supported” JVM.
- The latest stable version of Hadoop 1.x.x( here we are using the current stable version of hadoop-1.0.3)
- The latest stable version of HBase-0.9x.x( here we are using the current stable version of HBase-0.94.x)
Before Installing HBase, we have to install Hadoop and Zookeeper.
HBase is a Distributed, non-relational and open source database. One of the key value store type database is HBase which runs over Hadoop architecture and Hdfs file system.
Step 1: Copy the HBase tar in a particular location and untar it.We are using hbase-0.94.x.tar.gz
tar -xzvf hbase-0.94.x.tar.gz
Step 2: Edit the /home/hduser/Utilities/hbase/conf/hbase-env.sh and define the $JAVA_HOME
HBASE_MANAGES_ZK needs to be set as ‘true’ to use zookeeper.If it is set as false, HBase will not consider zookeeper.
Step 3: Edit the hbase-site.xml
A typical hbase-site.xml is given below
[code lang="shell"] <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:54310/hbase</value> </property> <property> <name>hbase.cluster.distributed </name> <value>true</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value><ipaddress of the zookeeper installed system></value> </property> <property> <name>hbase.master</name> <value>172.22.91.40:60000</value> <description>The host and port that HBase master runs</description> </property> </configuration> [/code]
The Value of ‘hbase.rootdir’ is the hostname and port number of system where namenode is running.(The port number should be same as that of core-site.xml, where namenode is running)
we have to create a folder in hdfs to store HBase data( This folder should mention in ‘hbase.rootdir’ value
hadoop fs -ls /
hadoop fs -mkdir /hbase
For multinode HBase installation,the property ‘hbase.zookeeper.quorum’ is important.the property is used to identify the zookeeper installed system.
- To start HBase daemons
- To stop HBase daemons
The default UI port of HBase is 60010.The UI of HBase can view by
http://<IP address of the system :60010>