主题是 MarkedForDeletion ,如何强制删除主题而不从磁盘和 Zookeeper 中积极删除主题
我们有kafka代理集群版本 - 2.7,我们有3个代理机器
我们通过以下cli删除了以下主题
bin/kafka-topics.sh --delete --zookeeper zoo01:2181 --topic my_first_car
1天后
我们仍然在kafka磁盘上看到主题,并且从以下命令
kafka-topics.sh --zookeeper zoo01:2181 --describe
Topic: my_first_car PartitionCount: 200 ReplicationFactor: 1 Configs: segment.bytes=1073741824,retention.bytes=7434770380 MarkedForDeletion: true
Topic: my_first_car Partition: 0 Leader: none Replicas: 1001 Isr: 1001 MarkedForDeletion: true
Topic: my_first_car Partition: 1 Leader: none Replicas: 1002 Isr: 1002 MarkedForDeletion: true
Topic: my_first_car Partition: 2 Leader: none Replicas: 1003 Isr: 1003 MarkedForDeletion: true
Topic: my_first_car Partition: 3 Leader: none Replicas: 1001 Isr: 1001 MarkedForDeletion: true
Topic: my_first_car Partition: 4 Leader: none Replicas: 1002 Isr: 1002 MarkedForDeletion: true
Topic: my_first_car Partition: 5 Leader: none Replicas: 1003 Isr: 1003 MarkedForDeletion: true
Topic: my_first_car Partition: 6 Leader: none Replicas: 1001 Isr: 1001 MarkedForDeletion: true
Topic: my_first_car Partition: 7 Leader: none Replicas: 1002 Isr: 1002 MarkedForDeletion: true
我们还注意到主题存在于zookeeper上/topics
因此,为了尝试完全删除这个主题,我们重新启动所有 Kafka 代理机器,但这没有帮助
删除该主题的下一步是什么 - my_first_car
很荒谬的是,Kafka 提供了 cli 来删除 topic,但实际上 topic 保留在 Kafka 磁盘上。
注意 - 我们最不想要的就是从磁盘和 Zookeeper 中删除 topic,但是这个是丑陋的方式
We have kafka broker cluster version - 2.7 , we have 3 brokers machines
We removed the following topic , by following cli
bin/kafka-topics.sh --delete --zookeeper zoo01:2181 --topic my_first_car
After 1 day
we still see the topics on kafka disk , and also from following command
kafka-topics.sh --zookeeper zoo01:2181 --describe
Topic: my_first_car PartitionCount: 200 ReplicationFactor: 1 Configs: segment.bytes=1073741824,retention.bytes=7434770380 MarkedForDeletion: true
Topic: my_first_car Partition: 0 Leader: none Replicas: 1001 Isr: 1001 MarkedForDeletion: true
Topic: my_first_car Partition: 1 Leader: none Replicas: 1002 Isr: 1002 MarkedForDeletion: true
Topic: my_first_car Partition: 2 Leader: none Replicas: 1003 Isr: 1003 MarkedForDeletion: true
Topic: my_first_car Partition: 3 Leader: none Replicas: 1001 Isr: 1001 MarkedForDeletion: true
Topic: my_first_car Partition: 4 Leader: none Replicas: 1002 Isr: 1002 MarkedForDeletion: true
Topic: my_first_car Partition: 5 Leader: none Replicas: 1003 Isr: 1003 MarkedForDeletion: true
Topic: my_first_car Partition: 6 Leader: none Replicas: 1001 Isr: 1001 MarkedForDeletion: true
Topic: my_first_car Partition: 7 Leader: none Replicas: 1002 Isr: 1002 MarkedForDeletion: true
We also notice that topics is exist on zookeeper under /topics
So in order to try to complete delete this topic we restart all Kafka broker machines , but this isn't help
What are the next steps to delete the topic - my_first_car
It is ridiculous , that Kafka provide cli to delete topic , but actually topic stay on Kafka disk
Note - the last thing that we want is to delete the topic from the disks and from the zookeeper , but this is the ugly way
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题似乎是
领导者:无
。不确定 ISR 列表如何更新为有效值,但 Zookeeper 和 Controller 节点之间似乎存在一些损坏,导致 Leader 未知,因此无法解析主题数据以将其删除。The issue appears to be
Leader: none
. Not sure how the ISR list is updated with valid values, but there seems to be some corruption between Zookeeper and the Controller node such that the Leader is unknown, so the topic data cannot be resolved in order to be deleted.