When/how does a topic “marked for deletion” get finally removed?

前端 未结 11 1010
天命终不由人
天命终不由人 2020-12-24 00:09

I have issued the command to delete a topic:

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

It seemed to

相关标签:
11条回答
  • 2020-12-24 00:38

    Check status of topic at zookeeper

    bin\windows>kafka-topics.bat --list --zookeeper localhost:2181
    Output: topic shows marked for deletion
    

    Setting delete.topic.enable=true in server.properties was not working as well.

    Solution: Check the zookeeper data directory location in zookeeper.properties file. it was dataDir=/tmp/zookeeper.
    Issue got resolved after updating "dataDir" to a new location.

    dataDir=zk-temp
    # the port at which the clients will connect
    clientPort=2181
    # disable the per-ip limit on the number of connections since this is a non-production config
    maxClientCnxns=0
    
    0 讨论(0)
  • 2020-12-24 00:39

    In my case where i am using Kafka 8.2.2, I had to delete entries from the following manually -

    1. Delete topic folder from Kafka broker machine.
    2. Login to zookeeper and -

      hbase zkcli
      rmr /brokers/topics/{topic_name}
      rmr /admin/delete_topics/{topic_name}
      
    0 讨论(0)
  • 2020-12-24 00:46

    In Kafka, once the topic is marked for deletion, it will get finally removed after 60000 milliseconds.

    Check the property log.segment.delete.delay.ms.

    The documentation says:

    file.delete.delay.ms: The time to wait before deleting a file from the filesystem Default value is 60000 ms.

    0 讨论(0)
  • 2020-12-24 00:52

    The deletion happened for me almost immediately (v 0.9). I believe that it should be the same for you.

    Once marked, the deletion will be triggered on the kafka node which is the topic partition leader. The thing to remember is that the the topic partition leader must be configured correctly (in terms of listeners), otherwise it will not receive the instruction to delete the logs.

    I had my "marked for deletion" topics stuck at that state until I corrected my server properties and restarted the respective node.

    0 讨论(0)
  • 2020-12-24 00:55

    The correct answer is actually the following. HOT off the Kafka-user's group email distribution list:

    François Langelier *@gmail.com über kafka.apache.org 05:57 (vor 1 Stunde)

    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

    0 讨论(0)
提交回复
热议问题