user432024
user432024

Reputation: 4675

How to permanently delete kafka topic?

Hi running this command kafka-topics --zookeeper localhost --delete --topic MyTopic

This works.

[2016-06-28 14:22:43,533] INFO Deleting index /data1/kafka/MyTopic-XX/00000000000000000000.index (kafka.log.OffsetIndex)
[2016-06-28 14:22:43,533] INFO Deleted log for partition [MyTopic,xx] in /data1/kafka/MyTopic-xx. (kafka.log.LogManager)

Where XX is the partition. When I go look at the kafka log dir the topic is deleted, but then after a few minutes it reappears.

When I look at kafka logs I see...

 INFO Created log for partition [MyTopic,XX] in /data1/kafka with properties {compression.type -> producer, message.format.version -> 0.10.0-IV1, file.delete.delay.ms -> 60000, max.message.bytes -> 1000012, message.timestamp.type -> CreateTime, min.insync.replicas -> 1, segment.jitter.ms -> 0, preallocate -> false, min.cleanable.dirty.ratio -> 0.5, index.interval.bytes -> 4096, unclean.leader.election.enable -> true, retention.bytes -> -1, delete.retention.ms -> 86400000, cleanup.policy -> delete, flush.ms -> 9223372036854775807, segment.ms -> 604800000, segment.bytes -> 1073741824, retention.ms -> 604800000, message.timestamp.difference.max.ms -> 9223372036854775807, segment.index.bytes -> 10485760, flush.messages -> 9223372036854775807}. (kafka.log.LogManager)
[2016-06-28 13:59:39,623] INFO Partition [MyTopic,XX] on broker 0: No checkpointed highwatermark is found for partition [MyTopic,XX] (kafka.cluster.Partition)

So it seems to be re-creating it somehow?

Thanks

Upvotes: 1

Views: 6430

Answers (1)

Kamal Chandraprakash
Kamal Chandraprakash

Reputation: 1992

Disable auto.create.topics.enable property in the broker.

CAUTION: This property is enabled by default. Requests from a producer / consumer to a topic which don't exists gets created automatically. If you going to disable it, make sure that you're creating the required topics before starting your client applications.

Upvotes: 3

Related Questions