Installing HBase on Ubuntu Linux

Aegis big data hadoop developer are sharing this tutorial with worldwide hadoop development community to make them learn installation of HBase on Ubuntu Linux in standalone mode. We will discuss every basic steps and prerequisites required for installing HBase to make you understand better.

=> We are introducing how to install HBase on Ubuntu Linux in standalone mode.

HBase Standalone Mode:

=> By default HBase runs in standalone mode. In standalone mode HBase uses local file system rather than HDFS.

=> HBase runs all daemons and zookeeper in same JVM in standalone mode.

Conventions that I followed in this artical:

commands
configuration file names  
Lines to be inserted in files.

Basic Prerequisites

=> Hadoop
=> Java
=> Loopback IP - Hbase aspects loopback IP to be 127.0.0.1

  • This tutorial has been tested using following environment.
OS : Ubuntu Linux(14.04 LTS) – 64bit Hadoop
Hadoop - 1.0.4 HBase
HBase - 0.94.6 Java
Oracle Java 1.7.0_75

-> In order to install HBase in standalone mode please follow below steps,
-> I am assuming that Java and hadoop are already installed and running properly, so I am not explaining those two prerequests in installation steps.

  1. Check your IP setup:

  • One of the weired problem occures is loopback IP problem. By default when you open hosts file in /etc/hosts, you see something like,

127.0.0.1 localhost
127.0.1.1 <server fqn> <server name, as in /etc/hostname>

now, change second line to,

127.0.0.1 localhost  
127.0.0.1 (name of your computer)

my /etc/hosts file looks like,
hadoop code 1

2. Download and extract HBase

  • Download HBase from here
  • Enter into directory, where HBase is downloaded, By default it is downloaded into /Downloads

             $ cd Downloads/

  • Extract tar file using following command

            $ tar -xzvf hbase-0.94.6.tar.gz

  • Create directory using following command in /user/lib

            $ sudo mkdir /usr/lib/hbase

  • Move extracted hbase-0.94.6 folder to newly created directory using following command

            $ mv hbase-0.94.6 /usr/lib/hbase/hbase-0.94.6

3. Configure Java for HBase

  • Open file {HBASE_INSTALL_DIRECTORY}/conf/hbase-env.sh and set path to java installed in your system.

  • My hbase-env.sh file looks like,

hadoopcode2

  • Set the HBASE_HOME path in bashrc file

  • I used gksu gedit $HOME/.bashrc command to edit file and appended following lines.

         #HBASE_PATH
         export HBASE_HOME=/usr/lib/hbase/hbase-0.94.6
         export PATH=$PATH:$HBASE_HOME/bin


  • hadoopcode3
=> Now, we have to set the directory path in conf/hbase-site.xml and add following lines to set hbase root directory where HBase will store its data.
=> By default, hbase.rootdir is set to /tmp/hbase-${user.name} that means you will 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.

<?xml version="1.0"?>
<?xml-stylesheet href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/{USER}/ {LOCATION_OF_DIRECTORY_WHERE_YOU_WANT_HBASE_STORES_DATA}</value>
</property>

<property>

<name>hbase.zookeeper.property.dataDir</name> <value>/home/{USER}/

{LOCATION_OF_DIRECTORY_WHERE_YOU_WANT_ZOOKEEPER_STORES_DATA} </value>
</property>
</configuration>


  • My hbase-site.xml looks like

hadoopcode4

Now you can start and stop hbase using following command

start-hbase.sh
hbase shell

To Stop HBase, Use following command

stop-hbase.sh

HBase also provides web interface

http://localhost:60010 master
http://localhost:60030 region server

Now, your HBase is running in standalone mode, you can run hbase shell commands.

Do try and let us know the feedback of this tutorial. To make queries related to hadoop development, you can mention your requirements below in the comments and our big data hadoop development programming will answer all your queries.
SHARE

Ethan Millar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment