Java and Hadoop should be installed on your Linux machine.
Use the below URL:
|$cd usr/local/$wget http://www.interior-dsgn.com/apache/hbase/stable/hbase-0.98.8-hadoop2-bin.tar.gz $tar -zxvf hbase-0.98.8-hadoop2-bin.tar.gz|
The above URL is used to download the HBase package.
Login as main user as per below given command.
|$su $password: enter your password here mv hbase-0.99.1/* Hbase/|
HBase in Standalone Mode
To install HBase, set Java Home and open the HBase-env.sh file from the conf folder. Edit the JAVA_HOME environment variable and change the current path to the current JAVA_HOME variable, as shown.
|cd /user/local/Hbase/conf gedit hbase-env.sh|
We can replace the current Java_Home value with its current value as per the command given below.
We can find hbase-site.xml inside / usr / local / Hbase. Open it and apply the code below in the configuration.
|<configuration> //Here you have to set the path where you want HBase to store its files. <property> <name>hbase.rootdir</name> <value>file:/home/hadoop/HBase/HFiles</value> </property> //Here you have to set the path where you want HBase to store its built in zookeeper files. <<property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/hadoop/zookeeper</value> </property> </configuration>|
After this, start Hbase to run the start-hbase.sh in the bin folder of Hbase.
|$cd /usr/local/HBase/bin $./start-hbase.sh|
HBase in Pseudo-Distributed Mode
Now let's test how pseudo-distributed mode is installed in HBase.
Configure Hadoop and HDFS on your local machine or remote device before continuing with HBase to make sure that they are running. Stop HBase if it's going to work.
Edit hbase-site.xml file to write the following items.
|<Property> <name>hbase.cluster.distributed</name> <value>true</value> </property>|
It will state the mode in which the HBase will run.Adjust the hbase.rootdir, your HDFS instance address, to the hdfs:/URI syntax in the same file on the local file system. HDFS runs at port 8030, on the local host.
|<Property> <name>hbase.rootdir </name> <value>hdfs://localhost:8030/hbase </value> </property>|
Open the browser in the Hbase folder after the configuration is done, and start Hbase using the following command.