文章详情

短信预约信息系统项目管理师 报名、考试、查分时间动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Hadoop2.x与Hadoop3.x副本选择机制

2017-08-04 04:48

关注

Hadoop2.x与Hadoop3.x副本选择机制

Hadoop2.x与Hadoop3.x副本选择机制

HDFS 上的文件对应的 Block 保存多个副本,且提供容错机制,副本丢失或者宕机自动恢复,默认是存 3 个副本。

2.8.x之前的副本策略

官方文档说明:

https://hadoop.apache.org/docs/r2.8.0/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html#Data_Replication

image-20220326111847444

For the common case, when the replication factor is three, HDFS’s placement policy is to put one replica on one node in the local rack, another on a different node in the local rack, and the last on a different node in a different rack. This policy cuts the inter-rack write traffic which generally improves write performance. The chance of rack failure is far less than that of node failure; this policy does not impact data reliability and availability guarantees. However, it does reduce the aggregate network bandwidth used when reading data since a block is placed in only two unique racks rather than three. With this policy, the replicas of a file do not evenly distribute across the racks. One third of replicas are on one node, two thirds of replicas are on one rack, and the other third are evenly distributed across the remaining racks. This policy improves write performance without compromising data reliability or read performance.

第一副本:放置在上传文件的 DataNode 上;如果是集群外提交,则随机挑选一个磁盘不太慢、CPU 不太忙的节点。

第二副本:放置在与第一个副本相同的机架的节点上

第三副本:与第二个副本相同机架的不同节点上

如果还有更多的副本:随机放在节点上,同时需要保持每个机架的副本数低于上限,基本上是((replicas - 1) / racks + 2)。

因为 NameNode 不允许 DataNodes 拥有同一个 block 的多个副本,所以能创建的最大副本数就是当时 DataNodes 的总数。

image-20220326111946934

2.9.x之后及3.x的副本策略

官方文档说明:

https://hadoop.apache.org/docs/r2.9.0/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html#Data_Replication

image-20220326111236998

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, another replica on a node in a different (remote) rack, and the last on a different node in the same remote rack. This policy cuts the inter-rack write traffic which generally improves write performance. The chance of rack failure is far less than that of node failure; this policy does not impact data reliability and availability guarantees. However, it does reduce the aggregate network bandwidth used when reading data since a block is placed in only two unique racks rather than three. With this policy, the replicas of a file do not evenly distribute across the racks. One third of replicas are on one node, two thirds of replicas are on one rack, and the other third are evenly distributed across the remaining racks. This policy improves write performance without compromising data reliability or read performance.

第一副本:放置在上传文件的 DataNode 上;如果是集群外提交,则随机挑选一个磁盘不太慢、CPU 不太忙的节点。

第二副本:放置在与第一个副本不同的机架的节点上

第三副本:与第二个副本相同机架的不同节点上

如果还有更多的副本:随机放在节点上,同时需要保持每个机架的副本数低于上限,基本上是((replicas - 1) / racks + 2)。

因为 NameNode 不允许 DataNodes 拥有同一个 block 的多个副本,所以能创建的最大副本数就是当时 DataNodes 的总数。

image-20220326110939205

原文地址:https://www.cnblogs.com/dawn-lewis/archive/2022/03/26/16058179.html

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯