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版)
250
12
1.
请求者无法知道集群是否启用了主题删除功能,而要删除的主题所在的集群可能刚好禁
用了主题删除功能。
2.
请求删除一个非常大的主题
,但在处理这个请求之前,一个或多个副本集因发生硬件故
障而离线,控制器无法对删除操作做出确认,也就无法完成删除操作。
要解决这个问题,需要先删除
/admin/delete_topic/<topic>
节点
。删除主题的
ZooKeeper
点(不是
/admin/delete_topic
父节点)等于删除了挂起的请求
。如果控制器中有缓存的请
求,它就会重新排队,所以在删除主题的节点后要立即强制转移控制器,确保控制器中没
有缓存的请求。
12.7.3
 手动删除主题
如果集群禁用了主题删除功能,或者需要通过非正式的途径删除某些主题,那么可以进
行手动删除。但是,这需要完全关闭集群中所有的
broker
,只要集群中有一个运行中的
broker
,就无法执行这个操作。
先关闭
broker
在集群还在运行的时候修改
ZooKeeper
中的元数据是很危险的
,这会造成集
群不稳定。所以,在集群还在运行的时候不要删除或修改
ZooKeeper
中的元
数据。
从集群中手动删除主题的过程如下。
1.
关闭集群中所有的
broker
2.
删除
ZooKeeper
中的
/brokers/topics/<topic>
路径,注意要先删除路径下的子节点。
3.
删除每一个
broker
的日志目录下的分区目录
,这些目录的名字可能是
<topic>-<int>
其中
<int>
是分区的
ID
4.
重启所有的
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