a file is split into one or more blocks and these blocks are stored in a set of DataNodes 一个文件会被拆分成1或者多个 block (块),然后存储在 DN 上
NameNode:NN
file system namespace 文件系统命名空间
执行文件系统的命名空间操作:打开、关闭、重命名文件或者文件目录
记录数据 block (块) 对应的 DN
DataNode:DN
HDFS 组件职责
NN
维护和管理文件系统的命名空间
副本策略
Block 的映射信息
处理客户端读写请求
DN
存储 Block
真正执行数据块的读写操作
Client
与 NN 交互,获取到文件的元数据信息
与 DN 交互,执行数据块的读写操作
管理 HDFS
SNN:Secondary NameNode
不是 NN 的热备
分担一些 NN 工作量:定期合并 FsImage Edits 完成后推送到 NN
Block
hadoop3.x 默认大小 128M
副本
For the common case, when the replication factor is three, HDFS’s placement policy is to put one replica on the local machine if the writer is on a datanode, otherwise on a random datanode in the same rack as that of the writer, another replica on a node in a different (remote) rack, and the last on a different node in the same remote rack.