在代理中设置kafka消息的最大生存期的位置?

时间:2016-09-13 15:56:37

标签: apache-kafka spark-streaming

lifetime中设置kafka条消息的最大broker的位置?什么是默认值?

如果我使用Kafka组合的Spark流媒体,这个设置有什么不同吗?

1 个答案:

答案 0 :(得分:3)

您可以使用以下命令在代理的 server.properties 文件中设置kafka主题的保留期(生命周期):

# The below configurations control the disposal of log segments. The policy can
# be set to delete segments after a period of time, or after a given size has accumulated.
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
# from the end of the log.

# The minimum age of a log file to be eligible for deletion
log.retention.hours=168

# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining
# segments don't drop below log.retention.bytes.
log.retention.bytes=1073741824