赞
踩
项目 | Value |
---|---|
zookeeper | 3.4.6 |
kafka | 2.13 |
cd /usr/local/kafka_2.13-2.4.1/logs/
rm -r test
grep 'zookeeper.connect' config/server.properties
删除kafka topic
/home/kafka/bin/kafka-topics.sh --delete --zookeeper xx:2181,xx:2181,xx:2181( 上图查询到的集群连接地址 ) --topic test
*此时并没有完全删除只是把相应topic的状态改为marked for deletion
删除zookeeper相关的路径
打开zookeeper client
/home/ZooKeeper/bin/zkCli.sh
执行下面的命令
把test替换成你要删除的topic
#删除topic test的consumer group,如果有消费记录的话
rmr /brokers/topics/【topic name】即可,此时topic被彻底删除。
完成
重启zookeeper和kafka可以用下面命令查看相关的topic还在不在:
bin/kafka-topics.sh --list --zookeeper xx:2181,xx:2181,xx:2181
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。