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权威指南
5
深入
Kafka
如果只是为了开发
Kafka
应用程序,或者只是在生产环境使用
Kafka
,那么了解
Kafka
内部工作原理不是必需的。不过,了解
Kafka
的内部工作原理有助于理解
Kafka
的行为,
也有助于诊断问题。本章并不会涵盖
Kafka
的每一个设计和实现细节,而是集中讨论以下
3
个有意思的话题:
Kafka
如何进行复制;
Kafka
如何处理来自生产者和消费者的请求;
Kafka
的存储细节,比如文件格式和索引。
在对
Kafka
进行调优时,深入理解这些问题是很有必要的。了解了内部机制,可以更有目
的性地进行深入的调优,而不只是停留在表面,隔靴搔痒。
5.1
 集群成员关系
Kafka
使用
Zookeeper
来维护集群成员的信息。每个
broker
都有一个唯一标识符,这个
标识符可以在配置文件里指定,也可以自动生成。在
broker
启动的时候,它通过创建
临时节点
把自己的
ID
注册到
Zookeeper
Kafka
组件订阅
Zookeeper
/brokers/ids
路径
broker
Zookeeper
上的注册路径),当有
broker
加入集群或退出集群时,这些组件就
可以获得通知。
如果你要启动另一个具有相同
ID
broker
,会得到一个错误——新
broker
会试着进行注
册,但不会成功,因为
Zookeeper
里已经有一个具有相同
ID
broker
broker
停机、出现网络分区或长时间垃圾回收停顿时,
broker
会从
Zookeeper
上断开连
接,此时
broker
在启动时创建的临时节点会自动从 ...
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