gpt4 book ai didi

apache-kafka - Apache 卡夫卡 : reduce kafka disk usage

转载 作者:行者123 更新时间:2023-12-05 05:15:57 25 4
gpt4 key购买 nike

我有一个关于Kafka磁盘的问题。当 Kafka 的磁盘已满时,它将失败。所以我想在Kafka磁盘使用率达到x%时,通过丢弃存储在Kafka磁盘上的旧数据(或者丢弃数据的副本),将磁盘使用率降低到x%以下。我是否需要修改 Kafka 源代码才能执行此操作?

最佳答案

您可以为您的主题配置retention.bytes

This configuration controls the maximum size a partition (which consists of log segments) can grow to before we will discard old log segments to free up space if we are using the "delete" retention policy. By default there is no size limit only a time limit. Since this limit is enforced at the partition level, multiply it by the number of partitions to compute the topic retention in bytes.

参见 https://kafka.apache.org/documentation/#topicconfigs

关于apache-kafka - Apache 卡夫卡 : reduce kafka disk usage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50985271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com