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
19
为什么使用
chroot
路径
Kafka
集群里使用
chroot
路径是一种最佳实践。
Zookeeper
群组可以共享
给其他应用程序,即使还有其他
Kafka
集群存在,也不会产生冲突。最好是
在配置文件里指定一组
Zookeeper
服务器,用分号把它们隔开。一旦有一个
Zookeeper
服务器宕机,
broker
可以连接到
Zookeeper
群组的另一个节点上。
4. log.dirs
Kafka
把所有消息都保存在磁盘上,存放这些日志片段的目录是通过
log.dirs
指定的。它是
一组用逗号分隔的本地文件系统路径。如果指定了多个路径,那么
broker
会根据“最少使
用”原则,把同一个分区的日志片段保存到同一个路径下。要注意,
broker
会往拥有最少
数目分区的路径新增分区,而不是往拥有最小磁盘空间的路径新增分区。
5. num.recovery.threads.per.data.dir
对于如下
3
种情况,
Kafka
会使用可配置的线程池来处理日志片段:
服务器正常启动,用于打开每个分区的日志片段;
服务器崩溃后重启,用于检查和截短每个分区的日志片段;
服务器正常关闭,用于关闭日志片段。
默认情况下,每个日志目录只使用一个线程。因为这些线程只是在服务器启动和关闭时会
用到,所以完全可以设置大量的线程来达到并行操作的目的。特别是对于包含大量分区的
服务器来说,一旦发生崩溃,在进行恢复时使用并行操作可能会省下数小时的时间。设置
此参数时需要注意,所配置的数字对应的是
log.dirs
指定的单个日志目录 ...
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