HBase is a column-oriented database management system that runs on top of Hadoop Distributed File System (HDFS). HBase can host very large tables, billions of rows, millions of columns and can provide real-time, random read/write access to Hadoop data.HBase scales linearly across very large datasets and easily combines data sources with different structures and schemas.
Prerequisites
JavaHadoop
Download HBase File
Download HBase 0.98.4 using below command on /usr/local directory.
$sudo wget http://archive.apache.org/dist/hbase/hbase-0.98.4/hbase-0.98.4-hadoop2-bin.tar.gz
/usr/local/
|
Unpack
hbase-0.98.4-hadoop2-bin.tar.gz file.
$ cd /usr/local
$ sudo tar –xvf hbase-0.98.4-hadoop2-bin.tar.gz
|
Rename hbase-0.98.4-hadoop2-bin to hbase
$ sudo mv hbase-0.98.4-hadoop2
hbase
|
Setting up environment for HBase
Edit ~/.bashrc file for set up the HBase
environment by appending the following lines.
$ sudo nano ~/.bashrc
|
export HBASE_HOME=/usr/local/hbase
export PATH=$HBASE_HOME/bin:$PATH
|
Reload the configuration file ~/.bashrc with the following command.
# source ~/.bashrc
|
Edit hbase-env.sh file.
$ cd /usr/local/hbase/conf
$ sudo nano hbase-env.sh
|
Set value for following environment variable.
export JAVA_HOME=/usr/local/jdk
export HBASE_REGIONSERVERS=/usr/local/hbase/conf/regionservers export HBASE_MANAGES_ZK=true |
Change the ownership and permissions of the directory /usr/local/hbase
$ sudo chown -R hdfs:hdfs /usr/local/hbase
$ sudo chmod -R 755 /usr/local/hbase
|
Edit Configuration Files
Edit hbase-site.xml and place the following
properties inside the file.
$ cd /usr/local/hbase/conf
$ sudo nano hbase-site.xml
|
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/hduser/hbase/zookeeper</value>
</property>
</configuration>
|
Check Version
Check the version of HBase
$ hbase version
2017-04-27 14:25:17,790
INFO [main] util.VersionInfo: HBase
0.98.4-hadoop2
2017-04-27 14:25:17,791
INFO [main] util.VersionInfo:
Subversion git://acer/usr/src/hbase -r
890e852ce1c51b71ad180f626b71a2a1009246da
2017-04-27 14:25:17,791
INFO [main] util.VersionInfo: Compiled
by apurtell on Mon Jul 14 19:45:06 PDT 2014
|
Start and verify the Services
Start HBase Server
$ start-hbase.sh
|
To verify the services will be start or not using following command.
$ jps
|
It should be provide following list of services.
15230 HMaster
15441 HRegionServer
|
Check whether HBaseproperly install or not
$ hbase shell
|
It showing HBase prompt
hbase(main):001:0>
|
To Stop HBase Server
$ stopt-hbase.sh
|
HBase Web Interfaces
Access your HBase Master server on port
60010 in your favourite web browser.
Access your HBase Master Region server on port 60030 in your favourite web browser