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版)
225
12
管理
Kafka
管理
Kafka
集群意味着需要使用额外的工具对主题、配置等做出修改。
Kafka
提供了一些
命令行工具,以用于对集群做出变更。这些工具使用
Java
实现,
Kafka
提供了一些脚本
来调用它们。不过,这些工具只提供了基本的功能,无法完成复杂的操作,难以被用于管
理大规模的集群。本章只介绍
Kafka
项目提供的基础工具
Kafka
社区也开发了很多高级
工具,虽然不属于
Kafka
核心项目,但是可以在
Kafka
网站上找到它们。
操作授权
虽然
Kafka
为主题操作提供了身份验证和授权机制
,但默认配置并没有对
这些工具的使用进行严格的限制。也就是说,不需要经过身份验证也可以
使用这些工具,并可以在没有安全检查和审计的情况下执行诸如修改主题
之类的操作。为防止发生未经授权的变更,需要确保只有管理员可以使用
这些工具。
12.1
 主题操作
可以用
kafka-topics.sh
执行大部分与主题相关的操作。可以用它创建、修改、删除和查
看主题。虽然这个工具也可用于配置主题的一些参数,但现在已被弃用,建议使用更健
壮的
kafka-config.sh
来配置主题参数。要使用
kafka-topics.sh
,需要通过
--bootstrap-
server
参数来指定集群的连接串和端口。下面的例子中使用的是本地
Kafka
集群,所以连
接串是
localhost:9092
本章假设所有工具都位于
/usr/local/kafka/bin/
目录
。本节示例中的命令都假设这个目录为
当前工作目录,或者这个目录已经被添加到
$PATH ...
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