3

I have a Kafka topic that seems to simultaneously exist and not exist.

kafka-topics.sh --bootstrap-server localhost:9092 --topic my-topic --delete 

returns an error:

Topics in [] does not exist

Meanwhile, trying to re-create the topic

kafka-topics.sh --bootstrap-server localhost:9092 --topic my-topic \
 --create --replication-factor 1 --partitions 1

returns

Topic already exists

It does not show up in the topics list with

kafka-topics.sh --list

I suspect some form of corruption but it's no clear how I can fully delete the topic so that it can be re-created

Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
wrschneider
  • 17,913
  • 16
  • 96
  • 176

1 Answers1

2

Instead of passing --bootstrap-server try with --zookeeper


kafka-topics.sh --zookeeper localhost:2181 --topic my-topic --delete
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156