Namenode

As mentioned in previous lessons, Namenode maintains the filesystem tree and all metadata for all files and directories in the tree. The file system metadata information is stored on the local disk of the Namenode by the following entities:

  • Namespace Image File
  • Edit Log

Namespace Image File (FS Image)

FsImage is a snapshot of the HDFS file system metadata at a certain point of time. It is a checkpoint of the file system’s metadata. Every modification to the filesystem is assigned a unique, monotonically increasing transaction ID. An FS image file represents the file system’s state after all modifications up to a specific transaction ID.

Edit log

EditLog is a transaction journal or log containing records for every change that occurs to the file system’s metadata after the most recent FS image.

Both the FS image and the edit log live on the local file system of the NameNode.

In the terminal, you’ll find the location of the fsimage and the editlogs at /usr/local/tmp/dfs/name/current/. The location is configured as the directory ${hadoop.tmp.dir}/dfs/name. In this case, the variable hadoop.tmp.dir is set to /usr/local/tmp/.

Get hands-on with 1200+ tech skills courses.