查看NameNode.java源文件
The NameNode controls two critical tables:
- filename->blocksequence (namespace)
- block->machinelist ("inodes")
The first table is stored on disk and is very precious.
The second table is rebuilt every time the NameNode comes up
—— NameNode.java
文件名和blocksequence(塊順序)信息永久保存在namenode節(jié)點(diǎn)上
但是block位置信息則是存在于內(nèi)存之中
查看Goole File System論文第2.6.2節(jié)(摘錄)
namenode節(jié)點(diǎn)并不永久保存datanode所擁有副本的信息,而是在每次啟動的時候輪詢datanode獲取這些信息截驮,并且通過周期性的心跳獲取最新的信息。
這種設(shè)計簡化了在有datanode服務(wù)器加入集群戳晌、離開集群、更名猴娩、失效橡娄、以及重啟的時候拔莱,namenode服務(wù)器和datanode服務(wù)器數(shù)據(jù)同步的問題。