1) Yes only these two files are there .
2) This is true for name node .
3) It is copied to secondary name node for persistent storage , things would work fine un till name node is up ,lets say you have done so many changes like creating directories ,files ,putting the data to hdfs and so on so during run time this information is directly loaded into the memory but what if namenode goes down so what ever new meta information was there which is not embedded current fsimage ,it would get lost permanently because when ever your system would come up it would load the fsimage into memory since its the old fsimage it won't have new changes . With this secondary name node we are preserving this changes in edit.log and finally edit.log file used for fsimage and new fsimage can be replaced with old one .
4) process is when ever meta data gets changes ,this event gets written in edit.log file and after some specified interval these logs copied to secondary name node when their size gets too big then edit.log information is flushed into the form of fsimage.
current fsimage would not get updated with addition or deletion of file ,these changes will directly cater in memory.
我覺得這本身http://stackoverflow.com/questions/24288942/hadoop-namenode-metadata-fsimage-and-edit-logs回答幾個你的問題。 – blackSmith 2014-09-30 13:53:49