Indefinite log retention on kafka

最后都变了- 提交于 2021-02-07 08:18:42

问题


I am using kafka for event-sourcing. I realized that we still need to configure the log retention time, i.e. log.retention.hours.

What is the best value to use if I want to keep all my messages indefinitely? The sample configuration for log.retention.bytes is set to -1, can I use -1 also in the log.retention.hours?


回答1:


See the following Kafka JIRA which is due for the 0.9.0.0 release. For the time being set as suggested:

log.retention.bytes = -1
log.retention.hours = 2147483647

Which is the same as forever (~250K years).

And then when the 0.9.0.0 release is available the log.retention.hours should have similar -1 value available.




回答2:


Yes you can.

If you want to retain all topics forever, you can set both log.retention.hours and log.retention.bytes to -1.



来源:https://stackoverflow.com/questions/32818820/indefinite-log-retention-on-kafka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!