Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 36 ยท Deployment and HA

Vault High Availability, Failover and Auto-Unseal

Learn how Vault high availability works: active and standby nodes, request forwarding, load balancers and health checks, plus auto-unseal with cloud KMS, recovery keys and seal migration.

A single Vault server is a single point of failure for every application that needs a secret. High availability (HA) runs several Vault servers over the same data so that one can fail without an outage. A second problem appears after every restart: Vault starts sealed, and someone must supply unseal key shares. Auto-unseal removes that manual step by letting a trusted external key service unseal Vault automatically.

Vault is not available on this site. Config and commands are real; the JavaScript blocks are stand-ins that model failover and the unseal threshold.

Active and standby nodes

In an HA cluster exactly one node is active and serves requests. The others are standbys. They are unsealed and waiting; if the active node dies, one standby takes over by acquiring the leadership lock (or winning the Raft election with Integrated Storage).

  • A standby that receives a request forwards it to the active node, or redirects the client using api_addr.
  • Performance standbys (Enterprise) can serve read requests locally to scale reads.
  • Failover takes seconds; clients should retry on connection errors.
flowchart TD
    LB["Load balancer"] --> A["Active node"]
    LB --> S1["Standby 1"]
    LB --> S2["Standby 2"]
    S1 -.->|"forward"| A
    S2 -.->|"forward"| A
    A --- ST[("Raft storage")]

Standbys forward to the active node; any node can receive traffic.

Load balancer health checks

Point your load balancer at /v1/sys/health. The status code tells it what each node is:

Code Meaning
200 Initialized, unsealed, active
429 Unsealed standby
472 Disaster recovery secondary
473 Performance standby
501 Not initialized
503 Sealed

To send traffic only to the active node, treat 200 as healthy. To let any unsealed node receive traffic (relying on forwarding), use ?standbyok=true.

JS Stand-in: classify health codes

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

No output.

Why auto-unseal

Vault encrypts its data with a data key, which is encrypted by a root key, which is protected by the seal. With the default Shamir seal the root key is split into N shares and any K recombine it (for example 3 of 5). Every restart needs K humans. At scale that is slow and risky.

With auto-unseal, Vault asks an external service to decrypt the root key at startup: AWS KMS, Azure Key Vault, GCP Cloud KMS, an HSM through PKCS#11, or another Vault's transit engine.

HCL
seal "awskms" {
  region     = "eu-west-1"
  kms_key_id = "alias/vault-unseal"
}

Access comes from the instance's IAM role, so no key lives in the file. Now servers restart and unseal themselves.

Recovery keys

With auto-unseal, Shamir shares become recovery keys. They no longer unseal Vault but authorize sensitive operations (generating a new root token, changing the seal, restoring in some cases). Distribute them as you did unseal keys.

Terminal
vault operator init -recovery-shares=5 -recovery-threshold=3

If the KMS key is deleted or access is lost, Vault cannot unseal and the data is gone for good. Protect the KMS key, enable deletion safeguards and keep a recovery plan.

JS Stand-in: Shamir threshold, K of N

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

No output.

Seal wrap and migration

Seal wrap (Enterprise) additionally wraps selected values (such as keys) with the seal, which helps with FIPS requirements. You can migrate between seal types: from Shamir to auto-unseal, or between KMS providers, by changing the seal stanza, restarting and running vault operator unseal -migrate with the old keys.

Checklist

  • Three or five nodes across zones; load balancer using /v1/sys/health.
  • Correct api_addr and cluster_addr (configuration).
  • Auto-unseal with a protected KMS key; recovery keys stored apart.
  • Clients retry with backoff; alerts on a node being sealed.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In an HA cluster, how many nodes serve writes at a time?

    One active node handles requests; standbys forward to it.
  2. 2. Which health code means a node is sealed?

    503 means sealed; 501 means not initialized.
  3. 3. With auto-unseal, what are the Shamir shares called?

    Recovery keys authorize sensitive operations but do not unseal.
  4. 4. What happens if the KMS key used for auto-unseal is permanently deleted?

    The seal key is required to decrypt the root key, so protect it.

Summary

  • One active node plus standbys; forwarding and health codes support load balancing.
  • Auto-unseal replaces manual unseal key entry using a KMS or HSM.
  • Shamir shares become recovery keys; protect the KMS key.
  • Seal types can be migrated.

Next: Audit Devices