Hadoop2.x与Hadoop3.x副本选择机制
HDFS 上的文件对应的 Block 保存多个副本,且提供容错机制,副本丢失或者宕机自动恢复,默认是存 3 个副本。
2.8.x之前的副本策略
官方文档说明:

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 的总数。

2.9.x之后及3.x的副本策略
官方文档说明:

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 的总数。

Hadoop2.x与Hadoop3.x副本选择机制的更多相关文章
- 图文了解 Kafka 的副本复制机制
让分布式系统的操作变得简单,在某种程度上是一种艺术,通常这种实现都是从大量的实践中总结得到的.Apache Kafka 的受欢迎程度在很大程度上归功于其设计和操作简单性.随着社区添加更多功能,开发者们 ...
- Go版本依赖--版本选择机制
目录 1. 版本选择机制 2.依赖包版本约定 2.1 Go module 之前版本兼容性 2.2 Go module 之后版本兼容性 3. 版本选择机制 3.1 最新版本选择 3.2 最小版本选择 1 ...
- Hadoop_HDFS文件读写代码流程解析和副本存放机制
Hadoop学习笔记总结 01.RPC(远程过程调用) 1. RPC概念 远程过程指的不是同一个进程的调用.它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议. 不能直接拿到远 ...
- Kafka 0.8 副本同步机制理解
Kafka的普及在很大程度上归功于它的设计和操作简单,如何自动调优Kafka副本的工作,挑战之一:如何避免follower进入和退出同步副本列表(即ISR).如果某些topic的部分partition ...
- Kafka副本同步机制
引用自:http://blog.csdn.net/lizhitao/article/details/51718185 Kafka副本 Kafka中主题的每个Partition有一个预写式日志文件,每个 ...
- 大数据入门基础系列之Hadoop1.X、Hadoop2.X和Hadoop3.X的多维度区别详解(博主推荐)
不多说,直接上干货! 在前面的博文里,我已经介绍了 大数据入门基础系列之Linux操作系统简介与选择 大数据入门基础系列之虚拟机的下载.安装详解 大数据入门基础系列之Linux的安装详解 大数据入门基 ...
- font and face, 浅探Emacs字体选择机制及部分记录
缘起 最近因为仰慕org-mode,从vim迁移到了Emacs.偶然发现org-mode中调出的calendar第一行居然没有对齐,排查一下发现是字体的问题.刚好也想改改Emacs的字体,于是我就开始 ...
- 大数据篇:HDFS
HDFS HDFS是什么? Hadoop分布式文件系统(HDFS)是指被设计成适合运行在通用硬件(commodity hardware)上的分布式文件系统(Distributed File Syste ...
- 深入理解 Kafka 副本机制
一.Kafka集群 二.副本机制 2.1 分区和副本 2.2 ISR机制 2.3 不完全的首领选举 2.4 最少同步副本 ...
随机推荐
- Solution -「ARC 104D」Multiset Mean
\(\mathcal{Description}\) Link. 读题时间≈想题时间,草.( 给定 \(N,K,M\),对于每个 \(x\in[1,N]\) 的整数 \(x\),统计多重集 ...
- Azure KeyVault(三)通过 Microsoft.Azure.KeyVault 类库在 .NET Core 上获取 Secrets
一,引言 上一篇文章,我们介绍了 Azure Key Vault 在实际项目中的用途,Azure Key Vault 作为密钥管理的服务,我们可以很轻松的利用它创建和控制用于加密的密钥,和管理证书和机 ...
- kubernetes集群之Pod说能不能让我体面的消亡呀?
kubernetes集群之Pod说能不能让我体面的消亡呀? 由于 Pod 所代表的是在集群中节点上运行的进程,当不再需要这些进程时允许其体面地终止. 1.如果 preStop 回调所需要的时间长于默认 ...
- VS2019下配置OpenGL全过程
一:下载VS2019 官网下载社区版 二:下载GLEW.GLFW 百度网盘地址: 链接:https://pan.baidu.com/s/1Uvz9svdnVRvDXNHjVgApig 提取码:rsgp ...
- 深入理解Java类加载机制,再也不用死记硬背了
谈谈"会"的三个层次 在<说透分布式事务>中,我举例里说明了会与会的差别.对一门语言的学习,这里谈谈我理解的"会"的三个层次: 第一层:了解这门语言 ...
- elasticsearch算法之搜索模型(一)
面对海量的信息,我们很容易被淹没在信息的海洋中:当我们需要查找某个信息的时候,我们就会输入能够体现我们意图的关键字,搜索引擎会通过解析我们的关键字从而构造相应的查询表示方法:然后搜索引擎通过构造的查询 ...
- Smartbi代替Alteryx+Tableau,用1份投入如何获得2份回报?
Smartbi是国内一家知名的BI厂商,Alteryx.Tableau是国外两款重要的BI工具,它们都是在BI领域内提供特定的功能,以满足企业的数据分析需求.那么,对于用户来说,在选择BI工具的时候要 ...
- 【C# 线程】ContextBoundObject类 --上下文绑定 和SynchronizationAttribute属性 、同步域
NET上下文的概念 应用程序域是进程中承载程序集的逻辑分区,在应用程序域当中,存在更细粒度的用于承载.NET对象的实体,上下文是用来确定对象的逻辑归属,那就.NET上下文Context.所有的.NET ...
- Qt:QSqlQuery
0.说明 QSqlQuery提供了执行SQL代码的方法. QSqlQuery封装了在QSqlDatabase中查询.检索数据的相关函数.它可以用来执行如SELECT.INSERT.UPDATE.DEL ...
- Python:wordcloud
wordcloud官方文档 1.简介 wordcloud是优秀的词云展示的第三方库 2.导入模块 import wordcloud 3.wordcloud对象初始化 以下参数值均为官方文档给出的默认值 ...