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.
Shut down both the source and destination HBase clusters.
Rename the HBase root folder in HDFS on the destination cluster. For example, rename
/apps/hbase
to/apps/hbase_OLD
.Remove any ZooKeeper data on the destination cluster.
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.
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.
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"
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.
Shut down the destination HBase cluster.
Note the current time stamp.
date +%s
Rename the HBase root folder in HDFS on the destination cluster. For example, rename
/apps/hbase
to/apps/hbase_OLD
.Remove any ZooKeeper data on the destination cluster.
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.
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.
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"
Stop any applications from writing data to HBase.
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.
Use the HBase IMPORT command to get exported tail data into the destination cluster.
Route traffic to the destination cluster.