How to see the retention for a particular topic in kafka

后端 未结 4 608
星月不相逢
星月不相逢 2020-12-24 01:33

I want to see the retention period set for a particular topic. Is there any command? I tried with

bin/kafka-topics.sh --zookeeper hostname:2181 --alter --con         


        
4条回答
  •  盖世英雄少女心
    2020-12-24 02:04

    If you have altered a topic and want to view the topic configuration the following command will be helpful

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

    This will describe only the topics along with configurations that have configurations set that differ from the cluster defaults.

    If you want to view the configurations for all topic Either you can view these properties log.retention.hours or log.retention.ms in server.properties in kafka config directory.

提交回复
热议问题