查看topic
bin/kafka-topics.sh --zookeeper 127.0.0.1:2181 --list
查看现有的bosssoft清理策略
bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name b-topic --describe
将默认的compact策略修改为delete
bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name b-topic --alter --add-config ‘cleanup.policy=delete’
查看kafka特定topic的详情,使用–topic与–describe参数
bin/kafka-topics.sh --zookeeper 127.0.0.1:2181 --topic b-topic --describe
同时设备清理策略为delete,compact
bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name b-topic --alter --add-config ‘cleanup.policy=[delete,compact]’
备注:
cleanup.policy=[delete, compact] 逗号后没有空格