3. Set Up the Configuration Files

There are several configuration files that need to be set up for HBase and ZooKeeper.

  • Extract the HBase and ZooKeeper configuration files.

    From the downloaded scripts.zip file, extract the files in configuration_files/hbase and configuration_files/zookeeper directory to separate temporary directories.

  • Modify the configuration files.

    In the respective temporary directories, locate the following files and modify the properties based on your environment. Search for TODO in the files for the properties to replace.

    1. Edit the zoo.cfg and modify the following properties:

      <property>     
       <name>server.1</name>     
       <value>$zk.server1.full.hostname:2888:3888</value>
       <description>Enter the 1st ZooKeeper hostname</description>
      </property>
      <property>     
       <name>server.2</name>     
       <value>$zk.server2.full.hostname:2888:3888</value>
       <description>Enter the 2nd ZooKeeper hostname</description>
      </property>
      <property>     
       <name>server.3</name>     
       <value>$zk.server3.full.hostname:2888:3888</value>
       <description>Enter the 3rd ZooKeeper hostname</description>
      </property>
    2. Edit the hbase-site.xml and modify the following properties:

      <property>     
       <name>hbase.rootdir</name>     
       <value>hdfs://$hbase.namenode.full.hostname:8020/apps/hbase/data</value>
       <description>Enter the HBase NameNode server hostname</description>
      </property>
      <property>     
       <name>hbase.master.info.bindAddress</name>     
       <value>$hbase.master.full.hostname</value>
       <description>Enter the HBase Master server hostname</description>
      </property>
      <property>     
       <name>hbase.zookeeper.quorum</name>     
       <value>$zk.server1.full.hostname,$zk.server2.full.hostname,$zk.server3.full.hostname</value>
       <description>Comma separated list of Zookeeper servers (match to what is specified in zoo.cfg but without portnumbers)</description>
      </property>

  • Copy the configuration files

    1. On all hosts create the config directory:

      rm -r $HBASE_CONF_DIR ;
      mkdir -p $HBASE_CONF_DIR ;
      
      rm -r $ZOOKEEPER_CONF_DIR ;
      mkdir -p $ZOOKEEPER_CONF_DIR ;
    2. Copy all the HBase configuration files to $HBASE_CONF_DIR and the ZooKeeper configuration files to $ZOOKEEPER_CONF_DIR directory.

    3. Set appropriate permissions:

      chmod a+x $HBASE_CONF_DIR/;
      chown -R $HBASE_USER:$HADOOP_GROUP $HBASE_CONF_DIR/../  ;
      chmod -R 755 $HBASE_CONF_DIR/../
      chmod a+x $ZOOKEEPER_CONF_DIR/;
      chown -R $ZOOKEEPER_USER:$HADOOP_GROUP $ZOOKEEPER_CONF_DIR/../  ;
      chmod -R 755 $ZOOKEEPER_CONF_DIR/../

where:

  • $HBASE_CONF_DIR is the directory to store the HBase configuration files. For example, /etc/hbase/conf.

  • $HBASE_USER is the user owning the HBase services. For example, hbase.

  • $ZOOKEEPER_CONF_DIR is the directory to store the ZooKeeper configuration files. For example, /etc/zookeeper/conf.

  • $ZOOKEEPER_USER is the user owning the ZooKeeper services. For example, zookeeper.


loading table of contents...