Delete topic in Kafka 0.8.1.1

后端 未结 14 1630
栀梦
栀梦 2020-11-30 19:26

I need to delete the topic test in Apache Kafka 0.8.1.1.

As expressed in the documentation here, I have executed:

bin/kafka-topics.sh --         


        
14条回答
  •  感情败类
    2020-11-30 19:59

    Steps to Delete 1 or more Topics in Kafka

    To delete topics in kafka the delete option needs to be enabled in Kafka server.

    1. Go to {kafka_home}/config/server.properties
    2. Uncomment delete.topic.enable=true
    

    Delete one Topic in Kafka enter the following command

    kafka-topics.sh --delete --zookeeper localhost:2181 --topic

    To Delete more than one topic from kafka

    (good for testing purposes, where i created multiple topics & had to delete them for different scenarios)

    1. Stop the Kafka Server and Zookeeper
    2. go to /tmp folder where the logs are stored and delete the kafkalogs and zookeeper folder manually
    3. Restart the zookeeper and kafka server and try to list topics,

    bin/kafka-topics.sh --list --zookeeper localhost:2181

    if no topics are listed then the all topics have been deleted successfully.If topics are listed, then the delete was not successful. Try the above steps again or restart your computer.

提交回复
热议问题