kafka定期清理过期数据

zkcharge 2019-09-29 05:05:47

制定了清理策略,但是还是每隔7天才会清理
清理策略如下:

############################# Log Retention Policy #############################

# The following 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 due to age
# 日志清理策略
log.cleanup.policy=delete
log.retention.hours=1
log.cleaner.enable=true

# A size-based retention policy for logs. Segments are pruned from the log unless the remaining
# segments drop below log.retention.bytes. Functions independently of log.retention.hours.
log.retention.bytes=1048576

# The maximum size of a log segment file. When this size is reached a new log segment will be created.
log.segment.bytes=10240

# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=300000

############################# Zookeeper #############################

...全文
898 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
罗亚方舟 2020-11-19
  • 打赏
  • 举报
回复
日志保存清理策略 属性名 含义 默认值 log.cleanup.polict 日志清理保存的策略只有delete和compact两种 delete log.retention.hours 日志保存的时间,可以选择hours,minutes和ms 168(7day) log.retention.bytes 删除前日志文件允许保存的最大值 -1 log.segment.delete.delay.ms 日志文件被真正删除前的保留时间 60000 log.cleanup.interval.mins 每隔一段时间多久调用一次清理的步骤 10 log.retention.check.interval.ms 周期性检查是否有日志符合删除的条件(新版本使用) 300000

1,261

社区成员

发帖
与我相关
我的任务
社区描述
Spark由Scala写成,是UC Berkeley AMP lab所开源的类Hadoop MapReduce的通用的并行计算框架,Spark基于MapReduce算法实现的分布式计算。
社区管理员
  • Spark
  • shiter
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧