You can manually perform a checkpoint to save the namespace of a NameNode and prevent you from taking an extended period of time to restart the NameNode. This topic describes how to manually perform a checkpoint on a NameNode.

Procedure

  1. Log on to your cluster in SSH mode. For more information, see Log on to a cluster.
  2. Run the following command to switch to the hdfs user:
    su hdfs
  3. Run the following command to enter the safemode mode:
    hdfs dfsadmin -safemode enter
    Important Checkpoints on a NameNode must be performed in safemode mode. In most cases, DfsClient automatically retries to perform a checkpoint if the checkpoint fails to be performed in safemode mode. We recommend that you perform this operation during off-peak hours.
  4. Run the following command to perform a checkpoint on the NameNode.
    We recommend that you perform this operation twice to accelerate the clearance of edit logs.
    hdfs dfsadmin -saveNamespace
    hdfs dfsadmin -saveNamespace
  5. Run the following command to exit the safemode mode:
    hdfs dfsadmin -safemode leave