可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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.
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?
回答1:
tl;dr Set delete.topic.enable = true
in config/server.properties
of Kafka brokers and...be patient.
It happens with the latest development version of Kafka 0.8.3-SNAPSHOT:
The point is to have delete.topic.enable=true
in config/server.properties
that you use to start a Kafka broker.
You can also ensure the setting be true in a broker's log:
回答2:
In my case where i am using Kafka 8.2.2, I had to delete entries from the following manually -
- Delete topic folder from Kafka broker machine.
Login to zookeeper and -
hbase zkcli rmr /brokers/topics/{topic_name} rmr /admin/delete_topics/{topic_name}
回答3:
You can do it.
sudo ./zookeeper-shell.sh localhost:2181 rmr /brokers/topics/your_topic
回答4:
I faced the same issue and spend a couple of days trying to identify with the issue was. I triggered command to delete the topics, however the topics were marked for deletion but they were not deleted.
- I first checked the configuration which are set right. Under: server.properties
delete.topic.enable=true for all brokers
- I restarted the broker to check if the topics got delete (No!!).
- I check no data under /kafka/data folder.
- I even considered the option to wait until the retention time got exceed.
None helped. I had to finally login to zooker
./zkCli.sh # and delete the topics using rmr /brokers/topics/> and rmr /admin/delete_topics/>
Please remember to restart kafka after this. Hope this solves your issue.
回答5:
The correct answer is actually the following. HOT off the Kafka-user's group email distribution list:
an users The delete topic isn't working ATM
I think it will be available in the next release https://issues.apache.org/jira/browse/KAFKA-1397
回答6:
My issue was something similar. I deleted a topic and it was giving me the same message when I was listing all the topics.
I brought down the zookeeper and the broker. set the delete.topic.enable=true in my broker config file started zookeeper and the boker
The topic was gone...thanks to Jacek Laskowski
回答7:
We had this issue when deleting topics. The topics had been created when delete.topic.enable=true had not been set. We set that in config, restarted kafka to apply the new config. Deleted the topics and saw the "marked for deletion". We then restarted kafka again. After 40 minutes though all topics had been deleted (9 topics with total partitions in the thousands). The topics with higher numbers of partitions seemed to take longer, which initially made it look like nothing was happening.