Fsimage not recorded in the corresponding block DataNode, Why?

View fsimage by ovi and formatting. Section shows the following results.
<inode>
	<id>16386</id>
	<type>DIRECTORY</type>
	<name>user</name>
	<mtime>1512722284477</mtime>
	<permission>ch:supergroup:rwxr-xr-x</permission>
	<nsquota>-1</nsquota>
	<dsquota>-1</dsquota>
</inode>
<inode>
	<id>16387</id>
	<type>DIRECTORY</type>
	<name>ch</name>
	<mtime>1512790549080</mtime>
	<permission>ch:supergroup:rwxr-xr-x</permission>
	<nsquota>-1</nsquota>
	<dsquota>-1</dsquota>
</inode>
<inode>
	<id>16389</id>
	<type>FILE</type>
	<name>wc.input</name>
	<replication>3</replication>
	<mtime>1512722322219</mtime>
	<atime>1512722321610</atime>
	<perferredBlockSize>134217728</perferredBlockSize>
	<permission>ch:supergroup:rw-r--r--</permission>
	<blocks>
		<block>
			<id>1073741825</id>
			<genstamp>1001</genstamp>
			<numBytes>59</numBytes>
		</block>
	</blocks>
</inode >

The information loaded in the memory namenode can clearly be seen in fsimage, there is no record corresponding to each block where several datanodes correspondence table information, but only stores about all the namespace from the above fsimage information. The information in each block corresponds to the real datanodes list and no persistent storage in hadoop, but in all datanode start, each datanode local disk scanning, will report on this to save datanode block information to namenode, namenode upon receiving the report information for each block of datanode, the block information received, and in which it is datanode information stored in memory. (HDFS is done block by block information reporting this manner -> datanodes list .Datanode correspondence table constructed to process referred blockReport namenode report block information, and the namenode block -> datanodes list of information stored in a correspondence table called BlocksMap data structure.)

Published 20 original articles · won praise 22 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_43988989/article/details/104590230