3. Set Up the Configuration Files

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

  1. Extract the HBase configuration files to a temporary directory.

    The files are located in the configuration_files/hbase directory in the companion files.

  2. Modify the configuration files.

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

    • Edit zoo.cfg and modify the following properties:

      dataDir=$zk.data.directory.path
      server.1=$zk.server1.full.hostname:2888:3888
      server.2=$zk.server2.full.hostname:2888:3888
      server.3=$zk.server3.full.hostname:2888:3888
    • Edit 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.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>
    • Edit the regionservers file and list all the RegionServers hostnames (separated by newline character) in your environment. For example, see the sample regionservers file with hostnames RegionServer1 through RegionServer9.

      RegionServer1 
      RegionServer2 
      RegionServer3 
      RegionServer4 
      RegionServer5 
      RegionServer6 
      RegionServer7 
      RegionServer8 
      RegionServer9
  3. Copy the configuration files

    • 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;
    • Copy all of the HBase configuration files to the $HBASE_CONF_DIR.

    • Set appropriate permissions:

      chmod a+x $HBASE_CONF_DIR/;
      chown -R $HBASE_USER:$HADOOP_GROUP $HBASE_CONF_DIR/../;
      chmod -R 755 $HBASE_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.


loading table of contents...