prometheus快照:
啓動prometheus服務時加--web.enable-admin-api
/space/prometheus/prometheus --config.file=/space/prometheus/prometheus.yml --storage.tsdb.path=/space/prometheus/data --web.enable-admin-api
製作快照:
curl -XPOST http://localhost:9090/api/v2/admin/tsdb/snapshot
會在/space/prometheus/data/生成snapshots目錄,裏面是以日期開頭的子目錄,可將該目錄剪切到其它備份路徑
恢復快照:
將prometheus服務關閉,/space/prometheus/data目錄改名,然後將snapshots下日期開頭的目錄改名爲data,再開啓prometheus服務即可