MapR 5.0 Documentation : Upgrade from HBase 0.94.x to 0.98.x

This page contains the following steps to upgrade HBase 0.94.x to 0.98.x in the MapR distribution for Apache Hadoop:

1. Upgrade HBase Applications

Prior to performing an upgrade, check to see if your applications contain APIs that were deprecated in the release that you are upgrading to. If you find that an application contains deprecated APIs, update the application to use APIs supported by the version you are upgrading to and recompile the application.

For example, in HBase 0.98.x, the CoprocessorProtocol class is deprecated and RegionServer calls to this CoprocessorProtocol class may cause the RegionServer to fail. Prior to upgrade, disable jobs that use the CoprocessorProtocol class and modify the application to use the CoprocessorService instead of the CoprocessorProtocol class.

2. Update Repositories or Download Packages

MapR's rpm and deb repositories always contain the HBase version recommended for the latest release of the MapR core.  You can connect to an internet repository or prepare a local repository with any version of HBase you need. For more details on setting up repositories, see Preparing Packages and Repositories. You can also manually download packages to install. 

The following ecosystem repositories are available:

Repository 
MapR 5.x Ecosystem Repository (for repository install)http://package.mapr.com/releases/ecosystem-5.x.
All Ecosystem Packages (for manual install) http://package.mapr.com/releases/ecosystem-all/

To update the repository cache

If you plan to install from a repository, update the repository cache on each node where HBase is installed.

On RedHat and CentOS...

yum clean all

On Ubuntu...

apt-get update

3. Take Snapshot of the hbase Volume

Take a snapshot of the hbase volume. The snapshot creates a backup of the volume data that you can use to recover your data in the event that corruption occurs during the upgrade process.  For more information, see MapR Data Platform.

4. Backup Configuration Files

If you have changed configuration properties on your current installation of HBase, you probably want to apply those changes to the updated version. Configuration properties are located in /opt/mapr/hbase/hbase-<version>/conf/. Create a backup of any configuration files that contains customized values.

5. Upgrade HBase

Failure to follow these steps could leave the cluster in an inoperable state.

Complete the following steps to upgrade HBase: 

  1. Install the MapR HBase 0.98.x package on one node in your existing cluster that is not running HBase 0.94 but has connectivity to ZooKeeper and MFS services on the cluster:

    On RedHat or CentOS...
    yum install mapr-hbase
    On Ubuntu...
    apt-get install mapr-hbase

    If you do not have a node available on your cluster where you can complete this step (and you cannot add a node to serve this purpose)prepare an HBase node first.

    Do not install the HBase Master and RegionServer packages.

    Warning: Do not install HBase 0.98 packages on nodes that are running HBase 0.94 services. This will remove the 0.94 files, and you will not be able to cleanly shut down HBase 0.94 services on those nodes.
     

  2. On the node where you installed HBase 0.98.x, run configure.sh. 
    For example, you can run the following command if the node is already configured to access the cluster:

    $ /opt/mapr/server/configure.sh -R
    If this node is a new node with no existing MapR packages and services, you need to run configure.sh with additional options.
     
  3.  On the node where you installed HBase 0.98.x, run the following command to check for incompatible files on the nodes running HBase 0.94:

    $ /opt/mapr/hbase/hbase-0.98.x/bin/hbase upgrade -check

     

    If incompatible HFile format files are found, convert the files by running major compaction on the table. To run the compaction operation, run the following command on an HBase 0.94 node for each table that has the incompatible format:

    $ echo "major_compact '<table_name>'" | hbase shell

    Then, wait for the compactions to complete, as indicated on the HBase Master UI. 

    Note: A major compaction operation can have a significant impact on the cluster and should be run with caution, preferably when cluster traffic is minimal.

  4. On the node where you installed HBase 0.98.x, run the hbase upgrade -check command again to confirm that no incompatible files remain.
     

  5. Shut down the HBase 0.94.x services on the cluster. 
    Shut down the HBase Master services first, then the RegionServer services. You can use either the maprcli or the MCS to shut down the services.
     

  6. On the node where you installed HBase 0.98.x, run the following command to upgrade the HBase metadata:

    $ /opt/mapr/hbase/hbase-0.98.x/bin/hbase upgrade -execute

    Run this upgrade command once only for the entire cluster. You do not need to run it on each node. When this upgrade command is run successfully, the appropriate HBase packages can be upgraded to 0.98.x on each node.
     

  7. On each node with HBase 0.94.x installed, upgrade the packages using one of the following methods:

    To upgrade with a package manager:

    After configuring repositories so that the version you want to install is available, you can use a package manager to install from the repository. The upgrade process will remove all but the following directories in the current HBase directory: conf and logs.

    On RedHat and CentOS

    To upgrade an HBase region server node:

    yum upgrade mapr-hbase mapr-hbase-regionserver

    To upgrade an HBase master node:

    yum upgrade mapr-hbase mapr-hbase-master

    To upgrade an HBase client node:

    yum upgrade mapr-hbase
    On Ubuntu

    To upgrade an HBase region server node:

    apt-get install mapr-hbase mapr-hbase-regionserver

    To upgrade an HBase master node:

    apt-get install mapr-hbase mapr-hbase-master

    To upgrade an HBase client node:

    apt-get install mapr-hbase

    To upgrade by manually installing packages:

    On RedHat and CentOS
    1. Download the RPM package files mapr-hbase, mapr-hbase-master, and mapr-hbase-regionserver for version 0.98.x from http://package.mapr.com/releases/ecosystem-all.
    2. Install the package with rpm.
      To upgrade an HBase region server node:

      rpm -i --force mapr-hbase-0.98.<version>.noarch.rpm mapr-hbase-regionserver-0.98.<version>.noarch.rpm

      To upgrade an HBase master node:

      rpm -i --force mapr-hbase-0.98.<version>.noarch.rpm mapr-hbase-master-0.98.<version>.noarch.rpm
    On Ubuntu
    1. Download the RPM package files mapr-hbase, mapr-hbase-master, and mapr-hbase-regionserver for version 0.98.x from http://package.mapr.com/releases/ecosystem-all.
    2. Install the package with dpkg.
      To upgrade an HBase region server node:

      dpkg -i mapr-hbase_0.98.<version>_all.deb mapr-hbase-regionserver_0.98.<version>_all.deb

      To upgrade an HBase master node:

      dpkg -i mapr-hbase_0.98.<version>_all.deb mapr-hbase-master_0.98.<version>_all.deb

    If you have additional HBase services or libraries installed, you should also upgrade those packages to match the HBase version you are upgrading to. To upgrade an existing HBase Thrift Gateway, see Using the HBase Thrift Gateway.

  8. On each HBase node, migrate any custom configuration settings to the configuration files within the conf directory (opt/mapr/hbase/hbase-<version>/conf/)
     
  9. On each HBase node, run configure.sh -R:

    $ /opt/mapr/server/configure.sh -R

6. Start HBase Services


Start the upgraded HBase services. You can use either the maprcli or the MCS to start the services.