pandazx's blog

データ分析など雑多な技術ブログ

Prometheusサーバの移行(Snapshot)

  1. Prometheusサーバを「--web.enable-admin-api」オプションを付与して起動
  2. curl -XPOST http://localhost:9090/api/v1/admin/tsdb/snapshot」コマンドを実行(/var/lib/prometheus/dataにsnapshotsディレクトリが生成される)
  3. 生成されたsnapshots内のディレクトリを移行先サーバの/var/lib/prometheus/dataに格納
  4. 移行先のPrometheusサーバを起動

参考: