2.3.5. Stop Cluster and Checkpoint HDFS

  1. Using Ambari Web, browse to each Service except HDFS and ZooKeeper and perform Stop. Leave HDFS and ZooKeeper running for now.

  2. Perform the following steps on the NameNode host. If you are configured for NameNode HA, perform the following steps on the Active NameNode. You can locate the Active NameNode from Ambari Web > Services > HDFS in the Summary area.

  3. Check the NameNode directory to ensure that there is no snapshot of any prior HDFS upgrade. Specifically, using Ambari Web, browse to Services > HDFS > Configs, and examine the dfs.namenode.name.dir in the NameNode Directories property. Make sure that only a "/current" directory and no "/previous" directory exists on the NameNode host.

  4. Create the following log and other files. Creating these logs allows you to check the integrity of the file system after the Stack upgrade. As the HDFS user, " su -l <HDFS_USER> " run the following (where <HDFS_USER> is the HDFS Service user, for example, hdfs):

    • 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.

      hdfs fsck / -files -blocks -locations > dfs-old-fsck-1.log

    • Create a list of all the DataNodes in the cluster.

      hdfs dfsadmin -report > dfs-old-report-1.log

    • Optional: Capture the complete namespace of the file system. The following command does a recursive listing of the root file system:

      hadoop dfs -ls -R / > dfs-old-lsr-1.log

    • Optional: Copy all unrecoverable data stored in HDFS to a local file system or to a backup instance of HDFS.

  5. Save the namespace. As the HDFS user, " su -l <HDFS_USER> ", you must put the cluster in Safe Mode.

    hdfs dfsadmin -safemode enter

    hdfs dfsadmin -saveNamespace

    [Note]Note

    If your cluster is in a highly-available NameNode configuration, this command sets a checkpoint on the first NameNode host specified in the configuration in dfs.ha.namenodes.[nameserviceID]. Alternatively, you can also use the dfsadmin -fs option to specify which NameNode to connect. For example, to force a checkpoint in NameNode2: hdfs dfsadmin -fs hdfs://namenode2-hostname:namenode2-port -saveNamespace

  6. Copy the checkpoint files located in ${dfs.namenode.name.dir}/current into a backup directory.

    [Note]Note

    If your cluster is in a highly-available NameNode configuration, the location of the checkpoint depends on which NameNode host the saveNamespace was sent (as described in the previous step).

  7. Store the layoutVersion for the NameNode located at ${dfs.namenode.name.dir}/current/VERSION, into a backup directory where ${dfs.namenode.name.dir} is the value of the config parameter NameNode directories. This file will be used later to verify that the layout version is upgraded.

  8. Finalize any prior HDFS upgrade, if you have not done so already. As the HDFS user, " su -l <HDFS_USER> ", run the following:

    hdfs dfsadmin -finalizeUpgrade

  9. Using Ambari Web, stop HDFS service and stop ZooKeeper service.

  10. Using Ambari Web, review each service and make sure that all services in the cluster are completely stopped.


loading table of contents...