“标记为删除"的主题何时/如何被删除?终于被删了?

编程入门 行业动态 更新时间:2024-10-27 04:36:41
本文介绍了“标记为删除"的主题何时/如何被删除?终于被删了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我已发出删除主题的命令:

I have issued the command to delete a topic:

./bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic  vip_ips_alerts

似乎给出了一个快乐的回应:

It seemed to give a happy response:

[2014-05-31 20:58:10,112] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
Topic "vip_ips_alerts" queued for deletion.

但现在 10 分钟后该主题仍然出现在 --list 命令中:

But now 10 minutes later the topic still appears in the --list command:

./bin/kafka-topics.sh --zookeeper localhost:2181 --list
vip_ips_alerts - marked for deletion

那是什么意思?该主题何时真正被删除?我如何加快这个过程?

So what does that mean? When will the topic be really deleted? How do I expedite this process?

推荐答案

tl;drconfig/server 中设置 delete.topic.enable = true.卡夫卡经纪人的属性和...耐心等待.

tl;dr Set delete.topic.enable = true in config/server.properties of Kafka brokers and...be patient.

最新开发版本的 Kafka 0.8.3-SNAPSHOT 会发生这种情况:

It happens with the latest development version of Kafka 0.8.3-SNAPSHOT:

➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗ ./bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic my-topic --partitions 2 --replication-factor 1
Created topic "my-topic".

➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗ ./bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic my-topic
Topic:my-topic  PartitionCount:2    ReplicationFactor:1 Configs:
    Topic: my-topic Partition: 0    Leader: 0   Replicas: 0 Isr: 0
    Topic: my-topic Partition: 1    Leader: 0   Replicas: 0 Isr: 0

➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗ ./bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic my-topic
Topic my-topic is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.

➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗ ./bin/kafka-topics.sh --zookeeper localhost:2181 --list
➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗

关键是在 config/server.properties 中有 delete.topic.enable=true 用于启动 Kafka 代理.

The point is to have delete.topic.enable=true in config/server.properties that you use to start a Kafka broker.

➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗ grep delete.topic.enable config/server.properties
delete.topic.enable=true

您还可以确保经纪人日志中的设置为真:

You can also ensure the setting be true in a broker's log:

➜  kafka_2.11-0.8.3-SNAPSHOT git:(trunk) ✗ ./bin/kafka-server-start.sh config/server.properties
[2015-07-24 22:33:26,184] INFO KafkaConfig values:
        ...
        delete.topic.enable = true

这篇关于“标记为删除"的主题何时/如何被删除?终于被删了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-19 13:49:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/963146.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:删了   标记   主题   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!