我正在使用Lokiv2.4.2,并将S3配置为索引和块的存储后端。
我想确保所有90天以上的日志都被删除,而不会有腐败的风险。关于保留的文档是令人困惑的,步骤也不清楚。我是否应该在根前缀上的对象存储上设置TTL,即/
。或者我应该配置像这样的东西?我不想操作压紧器。
table_manager:
retention_deletes_enabled: true
retention_period: 2160h
这是我的Loki配置。请建议对此配置和相应的S3 TTL进行哪些更改。我不想操作压紧器。
config:
# existingSecret:
auth_enabled: false
ingester:
chunk_idle_period: 3m
chunk_block_size: 262144
chunk_retain_period: 1m
max_transfer_retries: 0
wal:
dir: /data/loki/wal
lifecycler:
ring:
kvstore:
store: inmemory
replication_factor: 1
## Different ring configs can be used. E.g. Consul
# ring:
# store: consul
# replication_factor: 1
# consul:
# host: "consul:8500"
# prefix: ""
# http_client_timeout: "20s"
# consistent_reads: true
limits_config:
max_query_series: 5000
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
schema_config:
configs:
- from: 2021-09-27
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: index_
period: 24h
server:
http_listen_port: 3100
storage_config:
aws:
s3: s3://ap-southeast-1/loki-s3-bucket
boltdb_shipper:
active_index_directory: /data/loki/boltdb-shipper-active
cache_location: /data/loki/boltdb-shipper-cache
cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
shared_store: s3
filesystem:
directory: /data/loki/chunks
chunk_store_config:
max_look_back_period: 0s
table_manager:
retention_deletes_enabled: false
retention_period: 0s
compactor:
working_directory: /data/loki/boltdb-shipper-compactor
shared_store: filesystem
发布于 2022-11-02 17:35:24
删除旧日志和索引数据似乎是S3的责任,而不是Loki。您需要向水桶中添加一个或多个生命周期规则来处理这个问题。
https://grafana.com/docs/loki/latest/operations/storage/retention/#table-manager
当使用S3或GCS时,存储块的桶需要正确设置过期策略。有关更多细节,请查看S3的文档或GCS的文档。
国际海事组织的Loki文档在这个主题上非常薄弱,我希望他们能更详细地讨论这个问题。
https://stackoverflow.com/questions/73412485
复制相似问题