Prometheus备份和还原 - 如何备份和恢复指标数据,警报,服务人员/工作从旧普罗米修斯到新普罗米修斯

发布于 2025-01-17 13:42:09 字数 966 浏览 5 评论 0原文

我想将指标数据、警报、服务监视器从一个普罗米修斯导出到另一个普罗米修斯。

  • 快照备份和恢复的工作方式与备份所有内容一样(仅 指标数据(或)服务监视器/作业、警报、指标就是一切 备份)?
  • 如何在新的prometheus中恢复快照?
  • 如何验证metrics是否导入到新的prometheus中?
  • 还有一种方法可以备份警报规则, servicemonitors/jobs 并将其恢复到新的普罗米修斯?

注意:Prometheus 是使用 Kube-prometheus-stack/prometheus-operator 部署的。

发现很少有帖子建议使用“快照”或“指向旧 PV”方法来备份 prometheus 数据。

  1. 我删除了以前的文件夹并将新的快照文件夹添加为 这些链接中建议 - https://suraj.io/post/how-to-backup -and-restore-prometheus/ https://devopstales.github.io/kubernetes/backup-and-retore -普罗米修斯/ 但在新的prometheus中无法看到恢复的数据。

  2. 尝试将我的持久卷指向旧 PV,如此处所述 -https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/ 在这种方法中我也无法看到指标, 服务监视器/作业、警报正在备份!

I want to export metrics data, alerts, servicemonitors from one prometheus to another prometheus.

  • How snapshot backup and restore works as in what all things are backed up (only
    metrics data (or) servicemonitors/jobs, alerts, metrics is everything
    backed up)?
  • How to restore the snapshot in new prometheus?
  • How to verify if the metrics are imported to new prometheus?
  • Also is there a way to take backup of alert rules,
    servicemonitors/jobs and restore it to new prometheus?

Note: Prometheus is deployed using Kube-prometheus-stack/prometheus-operator

Found few posts which suggests to use "snapshot" or "pointing to old PV" methods to backup the prometheus data.

  1. I deleted the previous folder and added my new snapshot folder as
    suggested in these links -
    https://suraj.io/post/how-to-backup-and-restore-prometheus/
    https://devopstales.github.io/kubernetes/backup-and-retore-prometheus/
    But couldn't able to see the restored data in new prometheus.

  2. Tried Pointing my Persistent volume to old PV as mentioned here
    -https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/
    In this method also i couldn't able to see metrics,
    servicemonitors/jobs, alerts getting backed up!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文