Skip to Content
Kafka权威指南(第2版)
book

Kafka权威指南(第2版)

by Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty
November 2022
Beginner to intermediate
346 pages
11h
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南(第2版)
32
2
2.7.2
 数据中心布局
在开发和测试环境中,人们并不太关心
Kafka
服务器在数据中心的物理位置,因为即使集
群在短时间内出现局部或完全不可用,也不会造成太大影响。但是,在生产环境中,服务
不可用就意味着金钱的损失,具体表现为无法为用户提供服务或不知道用户正在做什么。
这个时候,使用
Kafka
集群的复制功能就变得尤为重要
(参见第
7
章),而服务器在数据
中心的物理位置随之也变得重要起来。数据中心最好要有故障区域。如果在部署
Kafka
前没有考虑好这个问题,那么以后就需要耗费更高的成本来移动服务器。
Kafka
可以将新创建的分区分配给部署在不同机架上的
broker
(机架感知)
,确保单个分区
的副本不会都位于同一个机架。要做到这一点,必须正确配置每个
broker
broker.rack
参数。云环境中的故障区域也可以进行同样的配置。不过,这只适用于新创建的分区。
Kafka
集群不会监控哪些已有的分区不再有机架感知
(例如,由于分区重分配导致的),也
不会进行自动纠正。所以,建议使用集群均衡工具来保持分区的机架感知,比如
Cruise
Control
(参见附录
B
。恰当配置这个属性有助于确保持续的机架感知。
总的来说,最好把集群的
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

时间序列分析实战:基于机器学习和统计学

时间序列分析实战:基于机器学习和统计学

Aileen Nielsen
Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9787115601421