简体   繁体   English

HDFS联合中的块池如何运行

[英]How do block pools function in a HDFS Federation

So I was reading Hadoop: The Definitive Guide. 因此,我正在阅读Hadoop:权威指南。 A sentence in this page was what got me confused. 这个页面上的一句话让我感到困惑。 So I have created an image depicting each sentence. 因此,我创建了一个描述每个句子的图像。

HDFS联盟

The sentence says, 这句话说

Under federation, each namenode manages a namespace volume (the black squares depict the namespace volume), which is made up of the metadata for the namespace, and a block pool (depicted by the dark grey rectangle) containing all the blocks for the files in the namespace. 在联合身份验证下,每个名称节点管理一个名称空间卷 (黑色正方形表示该名称空间卷),该名称空间由该名称空间的元数据和一个块池 (由深灰色矩形表示)组成,其中包含文件中的所有块命名空间。 Namespace volumes are independent of each other (in the image they are individual to each name node, shared with none), which means namenodes do not communicate with one another, and furthermore the failure of one namenode does not affect the availability of the namespaces managed by other namenodes. 命名空间卷彼此独立 (在映像中,它们对于每个名称节点都是独立的,没有共享),这意味着名称节点之间不会相互通信,而且一个名称节点的故障不会影响所管理的名称空间的可用性由其他名称节点。 Block pool storage is not partitioned (and hence shared between all in the image), however, so datanodes register with each namenode in the cluster (again shared with all namenodes) and store blocks from multiple block pools (My question is how then we have more than one block pool? Doesn't the whole paragraph summarize that all the name nodes have meta data pointing to each block and therefore share a block pool?). 块池存储未分区 (因此在映像中的所有之间共享),因此,数据节点向群集中的每个名称节点注册 (再次与所有名称节点共享),并存储多个块池中的块 (我的问题是,我们如何一个以上的块池?整个段落难道不总结所有名称节点都有指向每个块的元数据,因此共享一个块池吗?)。

I am damn confused! 我真糊涂!

Your representation is inaccurate regarding the "Block pool" rectangle, it should read "Block pools". 您对“块池”矩形的表示不准确,应显示为“块池”。

I think it's worth looking at another representation: 我认为值得考虑另一种表示形式:

联邦

So basically each block pools are managed independently from one another, each one is a set of blocks that belong to a single namespace. 因此,基本上每个块池都是彼此独立管理的,每个块池都是一组属于单个名称空间的块。 The Namenodes don't talk to each other which makes sense. Namenode不会互相交谈,这很有意义。

The reason behind this from what I've read is that this allows a namespace to generate Block IDs for new blocks without the need for coordination with the other namespaces. 根据我所读的内容,其背后的原因是,这允许命名空间为新块生成块ID,而无需与其他命名空间进行协调。 The failure of a namenode does not prevent the datanode from serving other namenodes in the cluster. 名称节点的故障不会阻止数据节点为群集中的其他名称节点提供服务。

Just to get more clarity - in case NameNode NN-n in above diagram goes down,Pool-n also will be unavailable. 为了更清楚起见-如果上图中的NameNode NN-n出现故障,Pool-n也将不可用。 So the datanode blocks maintained in Pool-n will be inaccessible until the Namenone NN-n is restored. 因此,在恢复Namenone NN-n之前,无法维护Pool-n中维护的datanode块。 OR it happens otherwise 否则发生

I found this helpful, it from book hadoop-operations: 我发现这很有帮助,它来自于hadoop-operation的书:
As first glance, it doesn't seem that federation is different from simply having multiple discreet clusters, save for the client plugin to view them as a single logical namespace. 乍一看,似乎联盟与仅具有多个离散的集群没有什么不同,除了客户端插件将其视为单个逻辑名称空间外。 One of the major differentiating factors, however, is that each datanode in a federated cluster stores blocks for each namenode. 但是,主要的区别因素之一是联合群集中的每个数据节点都为每个名称节点存储块。 When each namenode is formated, it generates a block pool in which block data associated with that namenode is stored. 格式化每个名称节点时,它将生成一个块池,在其中存储与该名称节点关联的块数据。 Each datanode, in turn, stores data for multiple block pools, and communicates with each namenode. 每个数据节点依次存储多个块池的数据,并与每个名称节点通信。 When a namenode receives a heartbeat from a datanode, it learns about the total space on the datanode consumed by other block pools, as well as non-HDFS data. 当名称节点从数据节点接收到心跳信号时,它将了解其他块池占用的数据节点上的总空间以及非HDFS数据。 The rationale behind having all datanodes participate in all block pools rather than simply having discreet clusters is that this achieves better total utilization of datanode capacity. 让所有数据节点参与所有块池而不是简单地拥有离散的群集的基本原理是,这可以更好地利用数据节点的容量。 Instead, if we were to have a separate set of datanodes entirely for the heavily used namenode A, datanodes for namenode B would be underutilized while namenode A datanodes struggled to keep up with load. 相反,如果我们要为频繁使用的名称节点A单独拥有一组单独的数据节点,则名称节点B的数据节点将无法充分利用,而名称节点A的数据节点则难以跟上负载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM