1、修改配置
limits_config:
retention_period: 744h
retention_stream:
- selector: '{container="tempo"}' #按日志标签匹配
priority: 1
period: 168h
- selector: '{container="application-controller"}'
priority: 1
period: 150h
#retention_deletes_enabled: true 新版本已弃用,默认false,可以不用配置
compactor:
working_directory: /var/loki/compactor
compaction_interval: 1m
retention_enabled: true
retention_delete_delay: 1m
retention_delete_worker_count: 150
delete_request_store: s3
2、重启compactor服务 如果没有compator,可以ingester服务的启动命令添加compactor
loki:
compactor:
enabled: true
extraArgs:
- -compactor.working-directory=/loki/compactor
3、常见错误Loki compactor err="open /tmp/marker-view-3955168416: read-only file system 解决方法1:关闭tmp目录的只读限制
compactor:
securityContext:
readOnlyRootFilesystem: false
解决方法2:在helm的value文件配置tmp的临时卷
extraVolumes:
- name: tmp
emptyDir: {}
extraVolumeMounts:
- name: tmp
mountPath: /tmp
(责任编辑:liangzh) |