Prometheus 导出/导入数据进行备份
Prometheus export / import data for backup
如何在 Prometheus 中导出和导入数据?如果实例出现故障,您如何确保备份数据?
好像还没有这个功能,请问怎么办?
Prometheus 没有导出功能,尤其是没有导入功能。
如果出于某种原因需要保留prometheus收集的数据,可以考虑使用远程写入接口将其写入适合存档的地方,例如InfluxDB(配置为时序数据库)。
Prometheus 不是长期存储:如果数据库丢失,用户应该耸耸肩,咕哝 "oh well",然后重新启动 Prometheus。
感谢来自 IRC #prometheus 的 amorken。
从 Prometheus 2.1 版本开始,可以向服务器请求快照。该文档提供了更多详细信息 - https://web.archive.org/web/20200101000000/https://prometheus.io/docs/prometheus/2.1/querying/api/#snapshot
创建快照后,可以将其复制到某个地方以便安全保存,如果需要,可以使用此快照作为其数据库来创建新服务器。
文档网站不断更改所有 URL,此链接指向关于此的最新文档 -
https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis
有一个选项可以启用 Prometheus 数据复制到 remote storage backend. Later the data collected from multiple Prometheus instances could be backed up in one place on the remote storage backend. See, for example, how VictoriaMetrics remote storage can save time and network bandwidth when creating backups to S3 or GCS with vmbackup utility。
如何在 Prometheus 中导出和导入数据?如果实例出现故障,您如何确保备份数据?
好像还没有这个功能,请问怎么办?
Prometheus 没有导出功能,尤其是没有导入功能。
如果出于某种原因需要保留prometheus收集的数据,可以考虑使用远程写入接口将其写入适合存档的地方,例如InfluxDB(配置为时序数据库)。
Prometheus 不是长期存储:如果数据库丢失,用户应该耸耸肩,咕哝 "oh well",然后重新启动 Prometheus。
感谢来自 IRC #prometheus 的 amorken。
从 Prometheus 2.1 版本开始,可以向服务器请求快照。该文档提供了更多详细信息 - https://web.archive.org/web/20200101000000/https://prometheus.io/docs/prometheus/2.1/querying/api/#snapshot
创建快照后,可以将其复制到某个地方以便安全保存,如果需要,可以使用此快照作为其数据库来创建新服务器。
文档网站不断更改所有 URL,此链接指向关于此的最新文档 - https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis
有一个选项可以启用 Prometheus 数据复制到 remote storage backend. Later the data collected from multiple Prometheus instances could be backed up in one place on the remote storage backend. See, for example, how VictoriaMetrics remote storage can save time and network bandwidth when creating backups to S3 or GCS with vmbackup utility。