Prometheus - 使用Prometheus快照,迁移数据至vmstorage

2024-02-21

下载vmctl包

wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.90.0/vmutils-linux-amd64-v1.90.0.tar.gz
tar -xzvf vmutils-linux-amd64-v1.90.0.tar.gz

拍摄Prometheus数据快照

修改Prometheus启动命令,开启api管理

--web.enable-lifecycle --web.enable-admin-api
使用HTTP POST创建快照
curl -XPOST 127.0.0.1:9090/api/v1/admin/tsdb/snapshot
{"status":"success","data":{"name":"20240221T033030Z-38901c06b57f918d"}}
进入Prometheus --storage.tsdb.path下的snapshots查看快照,快照几乎不占用磁盘空间。

通过Prometheus快照进行传输

vmctl-prod prometheus --prom-snapshot=/prometheus/snapshots/0240221T033030Z-38901c06b57f918d --vm-addr=http://10.3.147.192:8480 --vm-concurrency=6 --vm-account-id=66
--vm-concurrency 并发数
--vm-account-id vm集群的account_id

标题:Prometheus - 使用Prometheus快照,迁移数据至vmstorage
地址:https://blog.njqhome.com:8443/articles/2024/02/21/1708486437540.html