Is there a way to delete all the data from a topic or delete the topic before every run?

后端 未结 13 1900
陌清茗
陌清茗 2020-12-12 10:33

Is there a way to delete all the data from a topic or delete the topic before every run?

Can I modify the KafkaConfig.scala file to change the logRetentionHour

13条回答
  •  鱼传尺愫
    2020-12-12 11:30

    All data about topics and its partitions are stored in tmp/kafka-logs/. Moreover they are stored in a format topic-partionNumber, so if you want to delete a topic newTopic, you can:

    • stop kafka
    • delete the files rm -rf /tmp/kafka-logs/newTopic-*

提交回复
热议问题