Skip to Content
Kafka权威指南
book

Kafka权威指南

by Neha Narkhede, Gwen Shapira, Todd Palino
January 2018
Beginner to intermediate
234 pages
7h 8m
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南
可靠的数据传递
89
如果跟随者副本不能满足以上任何一点,比如与
Zookeeper
断开连接,或者不再获取新消
息,或者获取消息滞后了
10s
以上,那么它就被认为是不同步的。一个不同步的副本通过
Zookeeper
重新建立连接,并从首领那里获取最新消息,可以重新变成同步的。这个过
程在网络出现临时问题并很快得到修复的情况下会很快完成,但如果
broker
发生崩溃就需
要较长的时间。
非同步副本
如果一个或多个副本在同步和非同步状态之间快速切换,说明集群内部出现
了问题,通常是
Java
不恰当的垃圾回收配置导致的。不恰当的垃圾回收配置
会造成几秒钟的停顿,从而让
broker
Zookeeper
之间断开连接,最后变成
不同步的,进而发生状态切换。
一个滞后的同步副本会导致生产者和消费者变慢,因为在消息被认为已
提交
之前,客户端
会等待所有同步副本接收消息。而如果一个副本不再同步了,我们就不再关心它是否已经
收到消息。虽然非同步副本同样滞后,但它并不会对性能产生任何影响。但是,更少的同
步副本意味着更低的有效复制系数,在发生宕机时丢失数据的风险更大。
我们将在下一节讲解在实际项目中这将意味着什么。
6.3
 
broker
配置
broker
3
个配置参数会影响
Kafka
消息存储的可靠性。与其他配置参数一样,它们可以
应用在
broker
级别,用于控制所有主题的行为,也可以应用在主题级别,用于控制个别主
题的行为。
在主题级别控制可靠性,意味着
Kafka
集群可以同时拥有可靠的主题和非可靠的主题。例
如,在银行里,管理员可能把整个集群设置为可靠的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習

精通機器學習

Aurélien Géron
精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115473271