Index / Install Apache HBase and Apache Zookeeper
Apache HBase is a NoSQL database and Apache Zookeeper performs cluster coordination.
On all server nodes, install RPMs.
yum -y install zookeeper hbase
For your convenience, we provide directories.sh and usersAndGroups.sh scripts for setting environment parameters. We strongly suggest you edit and execute these scripts to prepare your environment. See Prerequisites > Set Environment Parameters for more information.
Execute these commands on all nodes:
mkdir -p $HBASE_LOG_DIR;
chown -R $HBASE_USER:$HADOOP_GROUP $HBASE_LOG_DIR;
chmod -R 755 $HBASE_LOG_DIR;
mkdir -p $HBASE_PID_DIR;
chown -R $HBASE_USER:$HADOOP_GROUP $HBASE_PID_DIR;
chmod -R 755 $HBASE_PID_DIR;
mkdir -p $ZOOKEEPER_LOG_DIR;
chown -R $ZOOKEEPER_USER:$HADOOP_GROUP $ZOOKEEPER_LOG_DIR;
chmod -R 755 $ZOOKEEPER_LOG_DIR;
mkdir -p $ZOOKEEPER_PID_DIR;
chown -R $ZOOKEEPER_USER:$HADOOP_GROUP $ZOOKEEPER_PID_DIR;
chmod -R 755 $ZOOKEEPER_PID_DIR;
mkdir -p $ZOOKEEPER_DATA_DIR;
chmod -R 755 $ZOOKEEPER_DATA_DIR;
chown -R $ZOOKEEPER_USER:$HADOOP_GROUP $ZOOKEEPER_DATA_DIR
-
Download the HBase configuration files from here and the Zookepper configuration files from here to a temporary directory.
-
Modify the following parameters per your environment. Search for TODO in the configuration files for the properties to replace.
Parameter | Example | Description |
---|---|---|
server.1 | {zookeeper.server1.full.hostname}:2888:3888 |
Server 1 |
server.2 | {zookeeper.server2.full.hostname}:2888:3888 |
Server 2 |
server.3 | {zookeeper.server3.full.hostname}:2888:3888 |
Server 3 |
Parameter | Example | Description |
---|---|---|
hbase.rootdir | hdfs://{hbase.namenode.full.hostname}:8020/apps/hbase/data |
HBase name node server |
hbase.master.info.bindAddress | {hbase.master.full.hostname} | HBase master server |
hbase.zookeeper.quorum | server1.full.hostname,server1.full.hostname |
Comma separated list of Zookeeper servers (match to what is specified in zoo.cfg but without portnumbers) |
On all hosts create the config directory, copy the config files and set the permissions:
rm -r $HBASE_CONF_DIR ;
mkdir -p $HBASE_CONF_DIR ;
<copy the config files to $HBASE_CONF_DIR >
chmod a+x $HBASE_CONF_DIR/health_check ;
chown -R $HBASE_USER:$HADOOP_GROUP $HBASE_CONF_DIR/../ ;
chmod -R 755 $HBASE_CONF_DIR/../
rm -r $$ZOOKEEPER_CONF_DIR ;
mkdir -p $ZOOKEEPER_CONF_DIR ;
<copy the config files to $ZOOKEEPER_CONF_DIR >
chmod a+x $ZOOKEEPER_CONF_DIR/health_check ;
chown -R $ZOOKEEPER_USER:$HADOOP_GROUP $ZOOKEEPER_CONF_DIR/../ ;
chmod -R 755 $ZOOKEEPER_CONF_DIR/../
-
Execute these commands from Zookeeper nodes:
<login as $ZOOKEEPER_USER> /usr/lib/zookeeper/bin/zkServer.sh start $ZOOKEEPER_CONF_DIR/zoo.cfg
-
Execute these commands from HBase Master node:
<login as $HBASE_USER> /usr/lib/hbase/bin/hbase-daemon.sh --config $HBASE_CONF_DIR start master
-
Execute these commands from all HBase Region Server nodes:
<login as $HBASE_USER> /usr/lib/hbase/bin/hbase-daemon.sh --config $HBASE_CONF_DIR start regionserver
echo "echo status | hbase shell" > /tmp/hbasesmoke.sh
echo "echo disable 'usertable' | hbase shell" >> /tmp/hbasesmoke.sh
echo "echo drop 'usertable' | hbase shell" >> /tmp/hbasesmoke.sh
echo "echo create 'usertable', 'family' | hbase shell" >> /tmp/hbasesmoke.sh
echo "echo put 'usertable', 'row01', 'family:col01', 'value1' | hbase shell" >> /tmp/hbasesmoke.sh
echo "echo scan 'usertable' | hbase shell" >> /tmp/hbasesmoke.sh
sh /tmp/hbasesmoke.sh
Index | Prev: Install Apache Oozie | Install Apache HBase and Apache Zookeeper | Next: Install Apache Sqoop