1

by default all topics in our kafka cluster are with retention hours=24 , ( as defined in kafka server.properties )

we decided to decrease the retention hours only on topic test to 64000 ms

so we set the following retention hours - 64000 on topic test

kafka-configs.sh --zookeeper zoo_server:2181 --entity-type topics --alter --entity-name test -add-config retention.ms=64000

now we want to return the default retention hours on topic test ( to 24 hours ) ,as was before

we don't sure if the following kafka cli , really return the retention hours to 24 on topic test

kafka-configs.sh --zookeeper zoo_server:2181 --alter --entity-type topics --entity-name test --delete-config retention.ms

as I know the above delete the configuration of the retention in ms but I not sure if this is really what above command is doing

please advice if I am wrong?

NOTE: in order to get all data about retention for particular topic in kafka , we can do

kafka-topics.sh --zookeeper zoo_server:2181 --describe --topics-with-overrides

reference- How to see the retention for a particular topic in kafka

reference - Delete topic level config

reference - https://gankrin.org/explained-how-to-purge-a-running-kafka-topic/

additionally:

I can suggest other approach as:

kafka-configs.sh --zookeeper zoo_server:2181 --entity-type topics --alter --entity-name test -add-config retention.ms=86400000

its configure the 24 hours for test topic , but this is workaround but I preferred is to delete the configuration of retention in ms instead of set the retention in ms to 86400000

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
jessica
  • 2,426
  • 24
  • 66
  • Kafka is not related to Hadoop, so don't need to use that tag... Hard to tell what the problem you're having. Seems you posted a new question and this is working for you? – OneCricketeer Sep 10 '21 at 18:21

0 Answers0