当前位置:首页 > 开发 > 开源软件 > 正文

【Kafka十一】关于Kafka的副本管理

发表于: 2015-04-07   作者:bit1129   来源:转载   浏览:
摘要: 1. 关于request.required.acks   request.required.acks控制者Producer写请求的什么时候可以确认写成功,默认是0, 0表示即不进行确认即返回。 1表示Leader写成功即返回,此时还没有进行写数据同步到其它Follower Partition中 -1表示根据指定的最少Partition确认后才返回,这个在   Th

1. 关于request.required.acks

 

request.required.acks控制者Producer写请求的什么时候可以确认写成功,默认是0,

0表示即不进行确认即返回。

1表示Leader写成功即返回,此时还没有进行写数据同步到其它Follower Partition中

-1表示根据指定的最少Partition确认后才返回,这个在

 

This value controls when a produce request is considered completed. Specifically, how many other brokers must have committed the data to their log and acknowledged this to the leader? Typical values are

  • 0, which means that the producer never waits for an acknowledgement from the broker (the same behavior as 0.7). This option provides the lowest latency but the weakest durability guarantees (some data will be lost when a server fails).
  • 1, which means that the producer gets an acknowledgement after the leader replica has received the data. This option provides better durability as the client waits until the server acknowledges the request as successful (only messages that were written to the now-dead leader but not yet replicated will be lost).
  • -1, The producer gets an acknowledgement after all in-sync replicas have received the data. This option provides the greatest level of durability. However, it does not completely eliminate the risk of message loss because the number of in sync replicas may, in rare cases, shrink to 1. If you want to ensure that some minimum number of replicas (typically a majority) receive a write, then you must set the topic-level min.insync.replicas setting. Please read the Replication section of the design documentation for a more in-depth discussion

2. 关于min.insync.replicas

When a producer sets request.required.acks to -1, min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend). When used together, min.insync.replicas and request.required.acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with request.required.acks of -1. This will ensure that the producer raises an exception if a majority of replicas do not receive a write.

 

 

3. 关于Lead Partition和Follower Parttiion

 

Each partition has one server which acts as the "leader" and zero or more servers which act as "followers". The leader handles all read and write requests for the partition while the followers passively replicate the leader. If the leader fails, one of the followers will automatically become the new leader. Each server acts as a leader for some of its partitions and a follower for others so load is well balanced within the cluster.

 

也就是说,读写操作都是发生在每个Partition的Lead Partition上,Follower Partition只是用来做备份以便进行失败转移

 

 

4. default.replication.factor

每个Partition有几个副本,默认是1,即只有1个副本(即不做备份)

 

 

 

 

 

 

 

【Kafka十一】关于Kafka的副本管理

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
对Kafka offset的管理,一直没有进行系统的总结,这篇文章对它进行分析。 什么是offset offset是con
对Kafka offset的管理,一直没有进行系统的总结,这篇文章对它进行分析。 什么是offset offset是con
对Kafka offset的管理,一直没有进行系统的总结,这篇文章对它进行分析。 什么是offset offset是con
4 kafka
kafka设计原理介绍 背景介绍 Kafka简介   Kafka是一种分布式的,基于发布/订阅的消息系统。主要设
5 kafka
topics主题 producers 生产者(发布消息到主题) consumers 消费者(订阅主题并处理消息) broker
6 kafka
【原创声明】本文属作者原创,已授权InfoQ中文站首发,转载请务必在文章开头标明出自“Jason's Blog
7 kafka
转载自:http://www.cnblogs.com/tangr206/articles/2274845.html 基本概念 kafka的工作方式和其他M
1.概述   在《Kafka实战-入门》一篇中,为大家介绍了Kafka的相关背景、原理架构以及一些关键知识
Kafka 本质上是一个分布式的消息队列,但是也可以用来做日志传输的中转组件。它的主要特点如下: 分
在当前的大数据时代,第一个挑战是海量数据的收集,另一个就是这些数据的分析。数据分析的类型通常
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号