对 Hadoop namenode 内存使用的困惑

Confusion over Hadoop namenode memory usage

我对 Hadoop namenode 内存有一个愚蠢的怀疑 calculation.It 在 Hadoop 书(权威指南)中提到

"Since the namenode holds filesystem metadata in memory, the limit to the number of files in a filesystem is governed by the amount of memory on the namenode. As a rule of thumb, each file, directory, and block takes about 150 bytes. So, for example, if you had one million files, each taking one block, you would need at least 300 MB of memory. While storing millions of files is feasible, billions is beyond the capability of current hardware."

由于每取一个块,namenode最小内存应该是150MB而不是300MB.Please帮我理解为什么是300MB

我猜你读过 Tom White 的书的第二版。我已经第三版了,这个参考了postScalability of the Hadoop Distributed File System。进入post,我看了下一句:

Estimates show that the name-node uses less than 200 bytes to store a single metadata object (a file inode or a block).

HDFS NameNode中的一个文件是:一个文件inode + 一个block。每个对两者的引用都有 150 个字节。 1.000.000 个文件 = 1.000.000 个索引节点 + 1.000.000 个块引用(在示例中,每个文件占用 1 个块)。

2.000.000 * 150 字节 ~= 300Mb

我打link是为了让你验证我的论证是否有误