Rolling Upgrade Guide
Also available as:
PDF
loading table of contents...

Back up component metadata

To ensure that your cluster can roll back to its earlier state if necessary, back up your component metadata before starting the rolling upgrade process.

[Important]Important

Back up your component metadata in the following order.

  1. If Ranger is enabled, back up the Ranger policy database (see Upgrade Ranger in the Manual Upgrade Guide). If the audit records are in the Policy database, you can exclude the Audit table (xa_access_audit) from the export process.

  2. Back up the Oozie Metastore database (see Getting Ready to Upgrade in the Manual Upgrade Guide).

  3. Back up the Hive Metastore database (see Getting Ready to Upgrade in the Manual Upgrade Guide).

  4. Create a backup snapshot of HBase in case of failure during the upgrade process:

    echo ‘snapshot_all’ | hbase shell

    Note the name of the HBase snapshot.

  5. Back up Knox data. For example, if upgrading from 2.2.0.0-2041:

    su -l knox "mkdir -p /usr/hdp/2.2.0.0-2041/knox/data-bak"

    su -l knox "cp -r /usr/hdp/2.2.0.0-2041/knox/data /usr/hdp/2.2.0.0-2041/knox/data-bak"

  6. Prepare HDFS for rolling upgrade:

    1. In case you decide to perform a rollback operation later, start the process to create an fsimage. Run the following command from $HDFS_USER (for example, hdfs):

      hdfs dfsadmin -rollingUpgrade prepare

      You’ll see a message similar to the following:

      PREPARE rolling upgrade ...
      Preparing for upgrade. Data is being saved for rollback.
      Run "dfsadmin -rollingUpgrade query" to check the status for proceeding with rolling upgrade
      Block Pool ID: BP-288284058-240.0.0.10-1424468388939
      Start Time: Mon Feb 23 14:29:01 PST 2015 (=1424730541827)
      Finalize Time: <NOT FINALIZED>
    2. Check the status of the rollback image preparation:

      hdfs dfsadmin -rollingUpgrade query

    3. View the query results. Continue to check status (step b) until you see the following message:

      Proceed with rolling upgrade.

      For example:

      [hdfs@node-1 /]$ hdfs dfsadmin -rollingUpgrade query
      QUERY rolling upgrade ...
      Proceed with rolling upgrade:
      Block Pool ID: BP-288284058-240.0.0.10-1424468388939
      Start Time: Mon Feb 23 14:29:01 PST 2015 (=1424730541827)
      Finalize Time: <NOT FINALIZED>

When you see the message to proceed, continue with the next step. On a small (two or three node) cluster this should not take more than a minute.

If the "proceed" message is delayed, check the NameNode logs to see if there are any errors or exceptions immediately after running the command. This will help you determine whether to wait, retry the process, or downgrade.