Think before you speak, read before you think.

kafka修改 topic retention

查看所有的 topic

bin/kafka-topics.sh --list --zookeeper localhost:2181

修改为 60s


# bin/kafka-configs.sh --zookeeper localhost:2181 --alter --entity-name provider-service --entity-type topics --add-config retention.ms=60000

查看

# bin/kafka-configs.sh --zookeeper localhost:2181 --describe --entity-name provider-service --entity-type topics
Configs for topics:provider-service are retention.ms=60000

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *