Setup Hbase in Cloudera
Follow these steps
Install hbase
on all the machines
Install hbase-master
and zookeper-server
on your master machine
zookeeper-server automatically installs the base zookeper package also.
For hbase to start it needs to have zookeeper
Install hbase-region
server and zookeeper in all your slave machines
Modifying the HBase Configuration
To enable pseudo-distributed mode, you must first make some configuration changes. Open /etc/hbase/conf/hbase-site.xml
in your editor of choice, and insert the following XML properties between the <configuration>
and </configuration>
tags. Be sure to replace myhost
with the hostname of your HDFS NameNode (as specified by fs.default.name
or fs.defaultFS
in your hadoop/conf/core-site.xml
file). You may also need to change the port number from the default 8020
to another value.
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://myhost:8020/hbase</value>
</property>
Configuring for Distributed Operation
After you have decided which machines will run each process, you can edit the configuration so that the nodes may locate each other. In order to do so, you should make sure that the configuration files are synchronized across the cluster. Cloudera strongly recommends the use of a configuration management system to synchronize the configuration files, though you can use a simpler solution such as rsync to get started quickly.
The only configuration change necessary to move from pseudo-distributed operation to fully-distributed operation is the addition of the ZooKeeper Quorum address in hbase-site.xml. Insert the following XML property to configure the nodes with the address of the node where the ZooKeeper quorum peer is running:
Creating the /hbase
Directory in HDFS
Before starting the HBase Master, you need to create the /hbase directory in HDFS. The HBase master runs as hbase:hbase so it does not have the required permissions to create a top level directory.
To create the /hbase
directory in HDFS:
Starting the ZooKeeper Server
To start ZooKeeper after a fresh install:
Starting the HBase Master
On Red Hat and SLES systems (using .rpm packages) you can now start the HBase Master by using the included service script:
Starting the HBase Region Server:
Accessing HBase by using the HBase Shell
After you have started HBase, you can access the database by using the HBase Shell:
Hope this blog helped you in setting up HBase. Please let me know if you have any questions.
For further reference : Cloudera blog