问题如下:
1、今天忽然出现告警,kafka某节点出现磁盘使用率超过80%告警,回顾最近操作,没有什么大业务变动,此kafka集群已经平稳运行1300多天;
2、检查集群发现,只有此节点有异常,磁盘空间消耗过度;
百度了下,然后如下方案成功解决
查看现有的__consumer_offsets清理策略
bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name __consumer_offsets --describe
会有如下输出可以看到 cleanup.policy=compact,则说明cleanup.policy是compact
Configs for topics:__consumer_offsets are segment.bytes=104857600,cleanup.policy=compact,compression.type=producer
__consumer_offsets的确与普通topic在清理策略上不同,也就是参数cleanup.policy上,给__consumer_offsets手动添加了清理策略
bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name __consumer_offsets --alter --add-config 'cleanup.policy=delete'
添加完后检查变成了:
bin/kafka-configs.sh --zookeeper localhost: