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权威指南
初识
Kafka
7
生产者
Broker1
Broker2
主题A
的分区0
主题A
的分区1
主题A
的分区1
首领
首领
消息A/0 来自A/0的消息
来自A/1的消息
消息A/1
复制A/0 复制A/1
主题A
的分区0
消费者
Kafka集群
1-7:集群里的分区复制
保留消息
(在一定期限内)是
Kafka
的一个重要特性。
Kafka broker
默认的消息保留策略
是这样的:要么保留一段时间(比如
7
天),要么保留到消息达到一定大小的字节数(比
1GB
)。当消息数量达到这些上限时,旧消息就会过期并被删除,所以在任何时刻,可
用消息的总量都不会超过配置参数所指定的大小。主题可以配置自己的保留策略,可以将
消息保留到不再使用它们为止。例如,用于跟踪用户活动的数据可能需要保留几天,而应
用程序的度量指标可能只需要保留几个小时。可以通过配置把主题当作
紧凑型日志
,只有
最后一个带有特定键的消息会被保留下来。这种情况对于变更日志类型的数据来说比较适
用,因为人们只关心最后时刻发生的那个变更。
1.2.6
 多集群
随着
Kafka
部署数量的增加,基于以下几点原因,最好使用多个集群。
数据类型分离
安全需求隔离
多数据中心(灾难恢复)
如果使用多个数据中心,就需要在它们之间复制消息。这样,在线应用程序才可以访问到
多个站点的用户活动信息。例如,如果一个用户修改了他们的资料信息,不管从哪个数据
中心都应该能看到这些改动。或者多个站点的监控数据可以被聚集到一个部署了分析程序
和告警系统的中心位置。不过,
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