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权威指南
82
5
我们从分区首领开始,依次分配跟随者副本。如果分区
0
的首领在
broker 4
上,那么它的
第一个跟随者副本会在
broker 5
上,第二个跟随者副本会在
broker 0
上。分区
1
的首领在
broker 5
上,那么它的第一个跟随者副本在
broker 0
上,第二个跟随者副本在
broker 1
上。
如果配置了机架信息,那么就不是按照数字顺序来选择
broker
了,而是按照交替机架的方式
来选择
broker
。假设
broker 0
broker 1
broker 2
放置在同一个机架上,
broker 3
broker 4
broker 5
分别放置在其他不同的机架上。我们不是按照从
0
5
的顺序来选择
broker
,而
是按照
0
3
1
4
2
5
的顺序来选择,这样每个相邻的
broker
都在不同的机架上(如图
5-5
所示)。于是,如果分区
0
的首领在
broker 4
上,那么第一个跟随者副本会在
broker 2
上,
这两个
broker
在不同的机架上。如果第一个机架下线,还有其他副本仍然活跃着,所以分区
仍然可用。这对所有副本来说都是一样的,因此在机架下线时仍然能够保证可用性。
机架1 机架2
broker0
broker1 broker3
broker2
5-5:分配给不同机架 broker 的分区和副本
为分区和副本选好合适的
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