Skip to content
Tutorials Center
My learning

Topics

Lesson 31 of 36 ยท Operations and Integration

Vault Backup, Disaster Recovery and Monitoring

Plan Vault operations: Raft snapshots and restore, RPO and RTO, replication for disaster recovery, key metrics and health checks to alert on, and upgrade and maintenance routines.

A secrets manager is a critical dependency: if Vault is down or its data is lost, every application that needs a password is affected. Operating it well means three habits: back up regularly, practice recovery, and watch the right signals. This lesson covers each and gives a small calculator for your recovery targets.

Vault is not available on this site. Commands are real; JavaScript blocks are stand-ins for calculations.

Backups with Raft snapshots

With Integrated Storage a snapshot captures everything: secrets, policies, auth configuration, leases and the encrypted keyring.

Terminal
vault operator raft snapshot save /backups/vault-$(date +%F).snap
vault operator raft snapshot inspect /backups/vault-2030-01-01.snap
vault operator raft snapshot restore -force /backups/vault-2030-01-01.snap

Automate this (Enterprise has built-in automated snapshots to S3, GCS, Azure or local disk; open-source users use cron and a small script with a limited token). Store copies off-site, encrypted, and keep several generations.

A snapshot is only useful if you can unseal the restored cluster. It needs the same unseal or recovery keys (or the same KMS key) that protected the original. Losing those keys makes the snapshot worthless.

RPO and RTO

  • RPO (recovery point objective): how much data you can afford to lose. Hourly snapshots mean up to an hour of changes may vanish.
  • RTO (recovery time objective): how long recovery may take.
JS Stand-in: worst-case data loss and snapshot storage

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Replication for disaster recovery (Enterprise)

Vault Enterprise offers two replication modes:

  • Performance replication copies configuration and secrets to secondary clusters in other regions so clients read from nearby; secondaries serve requests.
  • Disaster recovery (DR) replication keeps a warm copy that does not serve clients until you promote it after the primary is lost.
Terminal
vault write sys/replication/dr/primary/enable
vault write sys/replication/dr/primary/secondary-token id=dr-eu
vault write sys/replication/dr/secondary/enable token=<wrapped-token>
vault write sys/replication/dr/secondary/promote dr_operation_token=<token>

Create a DR operation token in advance (with a batch token strategy) so you can promote during an emergency. Rehearse the failover, including how clients find the new primary (DNS, load balancer).

What to monitor

Enable telemetry and scrape /v1/sys/metrics?format=prometheus (needs a token with a suitable policy) or push to StatsD/Datadog.

Signal Why it matters
vault.core.unsealed Node sealed after restart
vault.core.active / leadership changes Frequent flapping signals problems
vault.raft.leader.lastContact High values mean replication delay
vault.expire.num_leases Lease buildup slows Vault
vault.audit.log_request_failure Audit device trouble blocks requests
vault.token.count Token leaks or runaway clients
Request latency and error rate User impact
Disk, memory, CPU, certificate expiry Basic host health

Also check GET /v1/sys/health from your monitoring system and alert when no node returns 200.

JS Stand-in: simple alert rules on metrics

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Maintenance routines

  • Upgrades: read the upgrade notes, take a snapshot, upgrade standbys first, then step down the active node (vault operator step-down) and upgrade it.
  • Certificates: renew listener TLS before expiry and reload with SIGHUP.
  • Rekey and rotate: vault operator rekey changes unseal/recovery shares; vault operator rotate rotates the encryption key.
  • Test restores quarterly into an isolated environment.
  • Keep a runbook: seal status, who holds recovery keys, how to promote DR.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which command saves a backup of an Integrated Storage cluster?

    Raft snapshots contain all Vault data and are the basis of backups.
  2. 2. What does RPO describe?

    RPO is the maximum tolerable data loss, tied to backup frequency.
  3. 3. A DR secondary in Vault Enterprise:

    DR clusters stand by until promoted.
  4. 4. Why is a snapshot useless without matching keys?

    The data is protected by the root key, which needs the unseal or KMS keys.

Summary

  • Snapshot regularly, store off-site, test restores.
  • Define RPO and RTO; use DR replication in Enterprise for fast regional recovery.
  • Monitor sealed state, leases, replication delay and audit failures.
  • Keep upgrade, rekey and certificate routines documented.

Next: Vault Agent and Templates