Make sure that you completed the system preparation procedure; most importantly, save the namespace.
Stage the upgrade script:
Create an "Upgrade Folder", for example
/work/upgrade_hdp_2
, on a host that can communicate with Ambari Server. The Ambari Server host would be a suitable candidate.Copy the upgrade script to the Upgrade Folder. The script is available here:
/var/lib/ambari-server/resources/scripts/UpgradeHelper_HDP2.py
on the Ambari Server host.Make sure that Python is available on the host and that the version is 2.6 or higher:
python --version
Note For RHEL/Centos/Oracle Linux 5, you must use Python 2.6.
Start Ambari Server only. On the Ambari Server host:
ambari-server start
Back up current configuration settings and the component host mappings from MapReduce:
Go to the Upgrade Folder.
Execute the
backup-configs
action:python UpgradeHelper_HDP2.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME backup-configs
Where
$HOSTNAME
is the name of the Ambari Server host$USERNAME
is the admin user for Ambari Server$PASSWORD
is the password for the admin user$CLUSTERNAME
is the name of the cluster
This step produces a set of files named TYPE_TAG, where TYPE is the configuration type and TAG is the tag. These files contain copies of the various configuration settings for the current (pre-upgrade) cluster. You can use these files as a reference later.
Execute the
save-mr-mapping
action:python UpgradeHelper_HDP2.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME save-mr-mapping
This step produces a file named
mr_mapping
that stores the host level mapping of MapReduce components such as MapReduce JobTracker/TaskTracker/Client.
Delete all the MapReduce server components installed on the cluster.
If you are not already there, go to the Upgrade Folder.
Execute the
delete-mr
action.python UpgradeHelper_HDP2.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME delete-mr
Optionally, execute the delete script with the -n option to view, verify, and validate API calls, if necessary.
Note Running the delete script with the -n option exposes API calls but does not remove installed components. Use the -n option for validation purposes only.
The script asks you to confirm that you have executed the
save-mr-mapping
action and that you have a file namedmr_mapping
in the Upgrade Folder.