In hadoop hdfs-site.xml, there is a very important paramenter called dfs.name.name.dir, it stores namenode name table(fsimage).

This definition determines where on the local filesystem an DFS name node should store its namespace metainfo. It could be one directory. If multiple entries defined, separate them with comma.

Directories that do not exist will be created if local filesystem permission allows.

The reconginzed format is:

file://${hadoop.tmp.dir}/dfs/name

For multiple entries, separate entries by comma, here is an example:

<property>
  <name>dfs.namenode.name.dir</name>
    <value>file:///disk/c0t2,/disk/c0t3,/disk/c0t4,/disk/c0t5/dfs/name</value>
</property>

How does dfs.namenode.name.dir work with multiple entries?

When dfs.namenode.name.dir has multiple values, namenode will store the name table(fsimage) on each of the directory entry, hense, replicated in all of the directories, for redundancy.