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
- Log on to your cluster in SSH mode. For more information, see Log on to a cluster.
- Run the following command to switch to the hdfs user:
su hdfs - Run the following command to enter the safemode mode:
hdfs dfsadmin -safemode enterImportant 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. - 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 - Run the following command to exit the safemode mode:
hdfs dfsadmin -safemode leave