Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to delete Topics from kafka

Tags:

apache-kafka

even after enabling delete.topic.enable=true in server.config deletion of topics not working . i am getting following error on recreating the topic again

Topic 'test' already exists.
[2017-05-23 06:47:05,757] ERROR 
org.apache.kafka.common.errors.TopicExistsException: Topic 'test' already exists.
like image 655
chetan dev Avatar asked May 23 '17 10:05

chetan dev


2 Answers

You can not delete a topic when consuming it. Use bin/kafka-consumer-groups.sh or simple ps -aux|grep Consumer to find any possible consumers which block the operation.

like image 74
petertc Avatar answered Oct 10 '22 03:10

petertc


remove meta data in zookeeper

./bin/zookeeper-shell.sh localhost:2181
rmr /brokers/topics/mytopic
rmr /admin/delete_topics/mytopic
like image 4
happing lai Avatar answered Oct 10 '22 05:10

happing lai