在0.21.0中,可以通过Checkpoint Node和Backup Node做checkpoint
以下是官网对SecondaryNameNode的说明
The NameNode stores modifications to the file system as a log appended to a native file system file (edits). When a NameNode starts up, it reads HDFS state from an image file (fsimage) and then applies edits from the edits log file. It then writes new HDFS state to the fsimage and starts normal operation with an empty edits file. Since NameNode merges fsimage and edits files only during start up, the edits log file could get very large over time on a busy cluster. Another side effect of a larger edits file is that next restart of NameNode takes longer.
The secondary NameNode merges the fsimage and the edits log files periodically and keeps edits log size within a limit. It is usually run on a different machine than the primary NameNode since its memory requirements are on the same order as the primary NameNode. The secondary NameNode is started by bin/start-dfs.sh on the nodes specified in conf/masters file.
The start of the checkpoint process on the secondary NameNode is controlled by two configuration parameters.
fs.checkpoint.period, set to 1 hour by default, specifies the maximum delay between two consecutive checkpoints, and
fs.checkpoint.size, set to 64MB by default, defines the size of the edits log file that forces an urgent checkpoint even if the maximum checkpoint delay is not reached.
The secondary NameNode stores the latest checkpoint in a directory which is structured the same way as the primary NameNode's directory. So that the check pointed image is always ready to be read by the primary NameNode if necessary.
The latest checkpoint can be imported to the primary NameNode if all other copies of the image and the edits files are lost. In order to do that one should:
Create an empty directory specified in the dfs.name.dir configuration variable;
Specify the location of the checkpoint directory in the configuration variable fs.checkpoint.dir;
and start the NameNode with -importCheckpoint option.
The NameNode will upload the checkpoint from the fs.checkpoint.dir directory and then save it to the NameNode directory(s) set in dfs.name.dir. The NameNode will fail if a legal image is contained in dfs.name.dir. The NameNode verifies that the image in fs.checkpoint.dir is consistent, but does not modify it in any way.