Apache Hbase is the open source implementation of the Google’s big table NOSQL Database. It is the distributed, column oriented, NOSQL database that can use hadoop to store data. It provides us with the fast storage and retrieval of naturally occuring sparse data that may have a variable schema. We can further utilize the another layer like Apache pheonix, Apache hive to get SQL syntax compability.
Since the Hbase extends the Hadoop ecosystem we should first install Hadoop. Please follow the previous post on the installation of the Hadoop on Mac before proceding.
- Installing HBase Install hbase on mac using brew.
brew install hbase
- Connect with Hadoop We need to connect the Hbase to hadoop so that it utilizes the HDFS to store the data. The config file is present in hdfs-site.xml. Locate the location of the hdfs-site.xml using the following command.
find / -name "hdfs-site.xml"
Add the following config to the hdfs-site.xml. In the present configuration on my mac it is located on /usr/local/Cellar/hbase/1.2.8/libexec/conf/hbase-site.xml.
<property> <name>hbase.rootdir</name> <value>hdfs://localhost:8020/hbase</value> </property>
- Start HBase We will need to run the start-hbase.sh script provided to us the start the hbase.
We can get into the hbase shell using the following command.
We can stop the hbase service using following command.