To install Hbase, you first need the pig file. You can download it from:
https://www.apache.org/dyn/closer.lua/hbase/2.1.3/hbase-2.1.3-bin.tar.gz
Next, open the terminal and extract the files using this command:
$ cd Downloads
$ tar -xvf hbase-2.1.3-bin.tar.gz
Now, we need to make some changes to the configuration on HBase. The configuration files are stored in the conf directory. Let’s switch to that folder:
$ cd hbase-2.1.3/conf/
We need to set the Java path in the hbase-env.sh file. To find the Java path, run the following command:
$ echo $JAVA_HOME
This will print the Java Path.
Now, open the hbase-env.sh file with a text editor:
$ nano hbase-env.sh
And make the below entry:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
Remember to replace the path with the Java path on your system
Next, we need to make changes to the hbase-site.xml file. Open the file:
$nano hbase-site.xml
and make the below entries:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:/home/hadoop/HBase/HFiles</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/hadoop/zookeeper</value>
</property>
</configuration>
Now to start Hbase, switch to the bin directory:
$cd ../bin
and run the following command:
$ ./start-hbase.sh