4
votes

We are running Kafka via DCOS. We have a topic which appears to have some bad data. I would like to delete that topic.

Tried running: kafka-topics.sh --zookeeper --delete --topic

This said it had marked the topic for deletion but that it wouldn't work unless the "delete.topic.enable=true". Tried setting that for each broker using:

dcos kafka broker update 1 --options delete.topic.enable=true`

And then restarted the brokers

The topic is still there and still marked for deletion. How can I get the brokers to delete that topic?

1

1 Answers

0
votes

In order to override this parameter you need to add the following environment variable to the Kafka service :

KAFKA_OVERRIDE_DELETE_TOPICS=true

You can update this quite simply in the DCOS service definition, via edit button then Environment Variables form.

You'll notice it changes your configuration descriptor (json file) :

...
"env": {
   ...
   "KAFKA_OVERRIDE_DELETE_TOPICS": "true",
   ...
}
...

Once the service is restarted with this settings you can delete any topic using :

dcos kafka topic delete <topicname>