Chapter 5. Migrating HBase Data from HDP 1.3.x to HDP 2.0.x

This section describes how to manually migrate data between two HBase clusters, where the source cluster runs HBase 0.94 and the destination cluster runs HBase 0.96 and is empty of all data. This data migration may occur as part of a larger platform migration from HDP 1.3.x to HDP 2.0.x. HBase administrators can choose between two upgrade paths, depending on whether the organization can tolerate downtime for the source HBase cluster. Both scenarios assume that the HBase administrator has previously set up the destination HBase cluster with version 0.96.

Upgrading HBase with Significant Downtime

Use the following manual upgrade procedure for HBase if your organization can tolerate downtime for the entire HBase cluster.

  1. Shut down both the source and destination HBase clusters.

  2. Rename the HBase root folder in HDFS on the destination cluster. For example, rename /apps/hbase to /apps/hbase_OLD.

  3. Remove any ZooKeeper data on the destination cluster.

  4. Use the hadoop distcp command to move all data files from the HBase root directory in HDFS of the source cluster to the HBase root directory in the destination cluster.

    The command leaves the migrated data files using the 0.94 layout.

  5. Run the upgrade command on the destination HBase cluster as the HBase user to convert the data files to the 0.96 layout:

    sudo su -l $HBASE_USER -c "hbase upgrade -execute"

    You should see a completed Znode upgrade with no errors.

  6. Start the HBase services on the destination cluster as the HBase user:

    sudo su -l $HBASE_USER -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start master"
    sudo su -l $HBASE_USER -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start regionserver"
  7. Check processes.

    ps -ef | grep -i master
    ps -ef | grep -i region 

Upgrading HBase with Minimal Downtime

Use the following procedure to upgrade HBase if your organization requires minimal downtime for the source HBase cluster.

  1. Shut down the destination HBase cluster.

  2. Note the current time stamp.

    date +%s

  3. Rename the HBase root folder in HDFS on the destination cluster. For example, rename /apps/hbase to /apps/hbase_OLD.

  4. Remove any ZooKeeper data on the destination cluster.

  5. Use the hadoop distcp command to move all data files from the HBase root directory in HDFS of the source cluster to the HBase root directory in the destination cluster.

    The command leaves the migrated data files using the 0.94 layout.

  6. Run the upgrade command on the destination HBase cluster as the HBase user to convert the data files to the 0.96 layout:

    sudo su -l $HBASE_USER -c "hbase upgrade -execute"

    You should see a completed Znode upgrade with no errors.

  7. Start the HBase services on the destination cluster as the HBase user:

    sudo su -l $HBASE_USER -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start master"
    sudo su -l $HBASE_USER -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start regionserver"
  8. Stop any applications from writing data to HBase.

  9. Pass the time stamp noted in step 2 as an argument to the HBase EXPORT command on the source HBase cluster to migrate any data written since the time stamp.

  10. Use the HBase IMPORT command to get exported tail data into the destination cluster.

  11. Route traffic to the destination cluster.