删除kafka数据(docker安装)
作者:互联网
1.删除topic
①进入kafka容器
docker exec -it kfk bash
②使用客户端连接zookeeper
cd /opt/zookeeper/bin/
./zkCli.sh -server ip:2181 #此处写kafka地址,端口默认2181
执行删除命令
rmr /brokers/topics/topicname #topicname为要删除的topic
rmr /brokers/topics/__consumer_offsets
quit
2.查看kafka的挂载目录
cat /opt/kafka/config/server.properties | grep log.dirs
log.dirs=/kfk/kfk/data
3.退出容器、并删除topic
进入kafka的存储目录/kfk/kfk/data
cd /kfk/kfk/data
rm -rf topicname
4.重启kafka
标签:删除,kfk,topic,docker,kafka,data,topicname 来源: https://blog.csdn.net/GUY_GO/article/details/88742842