Use the following steps to prepare your system for the upgrade.
If you are upgrading Ambari as well as the stack, you must know the location of the Nagios and Ganglia servers for that process. Use the Services->Nagios/Ganglia-> Summary panel to locate the hosts on which they are running.
Use the Services view on the Ambari Web UI to stop all services, including MapReduce and all clients, running on HDFS. Do not stop HDFS yet.
Create the following logs and other files.
Because the upgrade to 1.3.2 includes a version upgrade of HDFS, creating these logs allows you to check the integrity of the file system post upgrade. While this is not absolutely necessary, doing so is strongly encouraged.
Run
fsck
with the following flags and send the results to a log. The resulting file contains a complete block map of the file system. You use this log later to confirm the upgrade.su $HDFS_USER hadoop fsck / -files -blocks -locations > /tmp/dfs-old-fsck-1.log
where
$HDFS_USER
is the HDFS Service user (by default,hdfs
).Capture the complete namespace of the filesystem. (The following command does a recursive listing of the root file system.)
su $HDFS_USER hadoop dfs -lsr / > /tmp/dfs-old-lsr-1.log
where
$HDFS_USER
is the HDFS Service user (by default,hdfs
).Create a list of all the DataNodes in the cluster.
su $HDFS_USER hadoop dfsadmin -report > /tmp/dfs-old-report-1.log
where
$HDFS_USER
is the HDFS Service user (by default,hdfs
).Optional: copy all or unrecoverable only data stored in HDFS to a local file system or to a backup instance of HDFS.
Optional: create the logs again and check to make sure the results are identical.
Save the namespace. You must be the HDFS service user to do this and you must put the cluster in Safe Mode.
hadoop dfsadmin -safemode enter hadoop dfsadmin -saveNamespace
Copy the following checkpoint files into a backup directory. You can find the directory by using the Services View in the UI. Select the HDFS service, the Configs tab, in the Namenode section, look up the property NameNode Directories. It will be on your NameNode host.
dfs.name.dir/edits
// depending on your system, may not existdfs.name.dir/image/fsimage
Stop HDFS. Make sure all services in the cluster are completely stopped.
If you are upgrading Hive, back up the Hive database.
Stop Ambari Server. On the Server host:
ambari-server stop
Stop Ambari Agents. On each host:
ambari-agent stop