Standalone Apache HBase

By default Apache HBase runs in standaleone mode. In standalone mode, HBase does not use HDFS — it uses the local file system instead — and it runs all Apache HBase daemons and a local zookeeper all up in the same JVM. Zookeeper binds to a well-known port so clients may talk to HBase. Apache HBase requires java 6 or newer version. If this is not the case, Apache HBase will not start.

Install Apache HBase bip media

The hbase-0.94.8 installation is done in below versions of Linux, Java and Hadoop respectively.

UBUNTU 13.4

JAVA 1.7.0_25

HADOOP 1.1.2

I have hduser as a dedicated hadoop system user. I had installed my Hadoop in /home/hduser/hadoop folder. Now I am going to install hbase in /usr/lib/hbase folder.

  • Download hbase-0.94.8.tar.gz from here
  • Enter into the directory where the stable version is downloaded. By default it downloads in “Downloads” directory
$ cd Downloads/

Unzip the tar file.

$ tar -xvf hbase-0.94.8.tar.gz

Create directory

$ sudo mkdir /usr/lib/hbase

move hbase-0.94.8 to hbase

$ mv hbase-0.94.8 /usr/lib/hbase/hbase-0.94.8
  • Configuring HBase with java
  • Open your hbase/conf/hbase-env.sh and set the path to the java installed in your system
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_25

Set the HBASE_HOME path in bashrc file

To open bashrc file use this command

hduser@system_name:~$ gedit ~/.bashrc

Apache

In bashrc file append the below 2 statements

export HBASE_HOME=/usr/lib/hbase/hbase-0.94.8
export PATH=$PATH:$HBASE_HOME/bin
  • At this point, you are ready to start Apache HBase. But before starting it, you might want to edit conf/hbase-site.xml and set the directory you want Apache HBase to write to, hbase.rootdir.
  • By default, hbase.rootdir is set to /tmp/hbase-${user.name} which means you’ll lose all your data whenever your server reboots
  • So replace DIRECTORY in the hbase-site.xml with a path to a directory where you want HBase to store its data.

Apache hbase-site.xml

?xml version="1.0"?
?xml-stylesheet type="text/xsl" href="configuration.xsl"?
configuration 
property 
name hbase.rootdir
value file:///home/hduser/HBASE/hbase
/property 
property 
name hbase.zookeeper.property.dataDir
value /home/hduser/HBASE/zookeeper
/property
/configuration

Extra steps

In /etc/hosts there are two entries:127.0.0.1 and 127.0.1.1.Change the second entry 127.0.1.1 to 127.0.0.1 otherwise it gives error: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing

To start Hbase [ in standalone mode no need to start hadoop ]

HBASE_PATH$bin/start-hbase.sh

HBASE_PATH$ bin/hbase shell

Apache

To stop HBase

HBASE_PATH$ bin/stop-hbase.sh

stopping hbase...............

To use the web interfaces

http://localhost:60010 for master

http://localhost:60030 for region server



Tags: , , , , ,

Spin up a cloud server in no time flat

Simple setup. Full root access. Straightforward pricing.


DEPLOY SERVER




Leave a Reply