2.1. Save the HDFS namespace

To save the HDFS namepsace:

  1. Open the command prompt using the Hadoop user account and go to the Hadoop home directory:

    runas /user:hadoop "cmd /K cd %HADOOP_HOME%"
  2. Place the NameNode in safe mode, to keep HDFS from accepting any new writes:

    hadoop dfsadmin -safemode enter
  3. Save the namespace.

    hadoop dfsadmin -saveNamespace
    [Note]Note

    Do NOT leave safe mode from this point onwards. HDFS should not accept any new writes.

  4. Finalize the namespace:

    hadoop namenode -finalize
  5. On the machine that hosts the NameNode, copy the following checkpoint directories into a backup directory:

    %HADOOP_HDFS_HOME%\hdfs\nn\edits\current
    %HADOOP_HDFS_HOME%\hdfs\nn\edits\image
    %HADOOP_HDFS_HOME%\hdfs\nn\edits\previous.checkpoint


loading table of contents...