【发布时间】:2019-10-11 06:45:09
【问题描述】:
我将 Prometheus helm chart 安装到 Kubernetes 集群进行监控。 默认情况下,
- prometheus 服务器的持久卷大小定义为 8Gi。
- Prometheus 服务器会将指标存储在此卷中 15 天(保留期)
在部署图表几天后,prometheus 服务器 pod 进入了 crashloopbackoff 状态。 从 pod 日志中查到的原因是:
level=error ts=2019-10-09T11:03:10.802847347Z caller=main.go:625 err="opening storage failed: zero-pad torn page: write /data/wal/00000429: no space left on device"
这意味着磁盘(永久卷)中没有可用空间来保存数据。 所以我清除了卷的现有数据并暂时修复了这个问题。
什么是正确的解决方案?
要规划一台 Prometheus 服务器的容量,可以使用粗略的公式:
needed_disk_space = retention_time_seconds * ingested_samples_per_second * bytes_per_sample
有人可以解释一下如何故意使用这个公式吗?
为什么 15 天的保留期 8Gi 大小不够?
编辑:
默认 8Gi 空间在 6 天后 100% 使用。
【问题讨论】:
标签: kubernetes prometheus persistent-storage