The entire filesystem namespace is contained in a file called the FsImage stored as a file in the NameNode’s local filesystem. The image file represents an HDFS metadata state at a point in time
The entire file system namespace, including the mapping of blocks to files and file system properties, is stored in a file called the FsImage. The FsImage is stored as a file in the NameNode’s local file system. Name Node creates an updated file system metadata by merging both files i.e. fsimage and edits on restart. The Name Node then overwrites fsimage with the new HDFS state and begins a new edits journal. The Checkpoint node periodically downloads the latest fsimage and edits from the active NameNode to create checkpoints by merging them locally and then to upload new checkpoints back to the active NameNode. This requires the same memory space as that of NameNode and so checkpoint needs to be run on separate machine. Namespace information lost if either the checkpoint or the journal is missing, so it is highly recommended to configure HDFS to store the checkpoint and journal in multiple storage directories.
The fsimage file is a persistent checkpoint of the filesystem metadata. However, it is not updated for every filesystem write operation, because writing out the fsimage file, which can grow to be gigabytes in size, would be very slow. This does not compromise resilience, however, because if the namenode fails, then the latest state of its metadata can be reconstructed by loading the fsimage from disk into memory, and then applying each of the operations in the edit log.