Kafka中Topic的删除
topic的删除
例子:删除testtopic
bin/kafka-topics.sh --list --zookeeper localhost:2181
1.删除kafka存储目录下对应的topic(server.properties)
ls
rm -rf test-0
rm -rf test-1
ls
2.进入zookeeper客户端删掉对应的topic
cd zookeeper-3.4.9/bin/
ls
./zkCli.sh
3.找到brokers中topic目录,并且删除对应的topic
ls /brokers/topics
rmr /brokers/topics/testtopic
ls /brokers/topics
4. 找到config中topic目录,并且删除对应的topic
ls /config/topics
rmr /config/topics/test
ls /config/topics
5.返回kafka,查看该topic是否被删除
bin/kafka-topics.sh --list --zookeeper localhost:2181