8

I need to configure Kafka never to delete logs. Looking at their documentation, I see two kinds of parameters that control this:

My question is:

What is the relationship between these two mechanisms, are these the only two, and are the above settings necessary and sufficient to prevent logs from ever being deleted?

Ryan Reich
  • 2,398
  • 2
  • 17
  • 15

2 Answers2

9

Not sure which version you are using. For me, I use this:

log.retention.hours=2147483647

That's roughly 245,000 years. I believe I tried -1 at some point, but using the max value worked. Perhaps log.retention.ms accepts different values, but regardless -- the second of your configuration options should be sufficient. My guess is neither option is necessary; either would be sufficient. Certainly, the second one is sufficient by itself.

David Griffin
  • 13,677
  • 5
  • 47
  • 65
0

As said in this answer, you can set -1 for log.retention.hours and log.retention.bytes.