Vault encrypts data before persisting it, writing only encrypted blobs to storage. Consul-backed storage used to be the de facto setup (we call this the classic setup in this article). Integrated storage (Raft) is now a first-class option, but Consul still makes sense when you already operate a strong Consul footprint or have specific multi-node requirements.
This article walks through the right way to use Consul storage and how it differs from integrated storage in real operations, following the points most commonly tested on the Vault Operations Professional exam.
Vault's storage "consul" backend stores already-encrypted data in the Consul KV and uses Consul sessions and locks to drive Vault's leader election and HA. Encryption and decryption happen in Vault's barrier layer, so no plaintext is ever written to Consul.
The defining trait of the classic setup is that availability and consistency are delegated to the Consul cluster. Operators can scale and upgrade Vault and Consul independently, and they can apply strict perimeter controls via Consul ACLs and TLS.
Example Vault server config using Consul as storage
storage "consul" {
address = "127.0.0.1:8500" # typically point to the local Consul agent
path = "vault/" # prefix in the Consul KV
token = "${CONSUL_ACL_TOKEN}" # required when ACLs are on (inject via env var)
scheme = "https" # mTLS recommended
tls_ca_file = "/etc/ssl/consul/ca.pem"
tls_cert_file = "/etc/ssl/consul/vault-consul.pem"
tls_key_file = "/etc/ssl/consul/vault-consul-key.pem"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 0
tls_cert_file = "/etc/vault/tls/server.crt"
tls_key_file = "/etc/vault/tls/server.key"
}
disoriented_behavior = "forbid" # version-dependent setting; verify in the official docsThe classic setup (Vault + Consul) depends on an external Consul cluster, and Vault achieves HA through the Consul KV and sessions. Integrated storage (Raft), by contrast, bundles Raft into Vault itself, achieving HA with no external dependency.
Vault's encryption boundary is identical in both, but the operational surface area, backup procedure, failure domain, and tuning knobs all differ. Use the table and diagram below to get the big picture, then choose based on your requirements.
| Aspect | Consul Storage (Classic) | Integrated Storage (Raft) |
|---|---|---|
| Operational scope | Operate Vault and Consul separately (upgrades, monitoring, backups all separate) | Operate only Vault (no external dependency) |
| HA / election | Election via Consul sessions and locks | Election via Vault's built-in Raft |
| Backup | consul snapshot save/restore (Consul-side procedure) | vault operator raft snapshot save/restore (Vault-side procedure) |
| Network | Low latency from Vault to Consul is required; typically routed through a local agent | Raft traffic between Vault nodes; inter-node latency dominates |
| Security | Consul ACLs and mTLS are required; Vault data is already encrypted at rest | Vault mTLS is required; Raft also runs under Vault's TLS |
| Availability domain | Spread both Consul and Vault across multiple AZs with an odd node count each | Spread Vault nodes across multiple AZs with an odd node count |
Big-picture view: classic setup (left) vs. integrated storage (right)
Annotated config snippet comparison
# Use Consul as storage (classic)
storage "consul" {
address = "127.0.0.1:8500"
path = "vault/"
token = "${CONSUL_ACL_TOKEN}"
scheme = "https"
}
# Integrated Storage (Raft)
# storage "raft" {
# path = "/opt/vault/data"
# node_id = "vault-1"
# retry_join = [{ leader_api_addr = "https://vault-1:8200" }]
# }When Consul ACLs are enabled, issue a least-privilege token for Vault. Vault only needs KV access under a specific prefix (for example, vault/) and the session/lock-related APIs. Standard practice is to require mTLS for Consul traffic and have Vault connect to the local Consul agent (127.0.0.1:8500).
If you are running Consul Enterprise with Namespaces, isolate Vault in its own namespace and prefix to avoid mistakes and collisions with other workloads. Manage the token through a secrets workflow (for example, Vault's own AppRole/Agent) so it can be rotated safely.
Example Consul ACL policy and Vault-side configuration
# Example Consul ACL policy (vault-policy.hcl)
# Allow only the prefix Vault actually uses
key_prefix "vault/" {
policy = "write"
}
# Appropriate permissions for sessions/locks
# (specifics vary by version; verify in the official docs)
node_prefix "" {
policy = "read"
}
# Create the token (example)
# consul acl policy create -name vault -rules @vault-policy.hcl
# consul acl token create -description "vault" -policy-name vault
# Vault-side config (inject via env vars)
# export CONSUL_HTTP_ADDR=https://127.0.0.1:8500
# export CONSUL_HTTP_TOKEN=<token>
# Reference the token inside storage "consul" in vault.hclWhen Vault uses Consul as storage, the performance bottleneck is Vault-to-Consul round-trip latency. The baseline approach is to colocate a Consul agent with every Vault node and use redundant LAN-internal links from agent to server. Avoid WAN hops.
Leader election depends on Consul sessions and locks. Session TTL and lock-delay are governed by Consul's behavior, so verify the defaults work for you through load tests. Too short and you get flapping; too long and failover takes longer. You also need an odd number of Consul servers (3 or 5) so the write quorum is satisfied.
Consul agent config (example for a Vault-colocated node)
datacenter = "dc1"
server = false
retry_join = ["provider=aws tag_key=consul tag_value=server"]
ca_file = "/etc/consul.d/ca.pem"
cert_file = "/etc/consul.d/agent.pem"
key_file = "/etc/consul.d/agent-key.pem"
encrypt = "<gossip_key>" # gossip encryption
verify_incoming = true
verify_outgoing = true
verify_server_hostname = true
# Local bind
bind_addr = "0.0.0.0"
client_addr = "127.0.0.1"
ports { http = 8500, https = 8501, grpc = 8502 }
acl { enabled = true default_policy = "deny" enable_token_persistence = true }For Consul storage, backups happen on the Consul side. Schedule regular consul snapshot save runs (which need no planned downtime) and store the output on separate storage. Restore against a Consul cluster of equivalent version and topology, then start Vault so it can perform barrier decryption. Always rehearse the backup/restore procedure and validate your RTO and RPO.
When migrating to integrated storage (Raft), the recommended procedure can vary depending on the Vault and Consul versions you are running. Pick either an offline migration (schedule a maintenance window, initialize a new cluster, transfer the data, then cut over) or a tool-assisted migration if your versions support it. Either way, the right move in practice is to rehearse in a test environment and have a rollback plan.
Backup/restore example (Consul side)
# Backup (run against the Consul server)
consul snapshot save /backups/consul-$(date +%F-%H%M).snap
# Restore (run during a maintenance window)
consul snapshot restore /backups/consul-YYYYMMDDHHMM.snap
# Reference: Raft snapshots for integrated storage run on the Vault side (for comparison)
# vault operator raft snapshot save raft-$(date +%F-%H%M).snap
# vault operator raft snapshot restore raft-*.snapThe Operations Professional exam often tests how you justify a storage choice, behavior during failures, backup and recovery, and secure connection configuration. Be ready to articulate Consul storage's characteristics in contrast to integrated storage.
Operational verification commands (surface health and dependencies)
# Vault status
vault status
# Consul members and leader
consul members
consul operator raft list-peers
# Connectivity from Vault to Consul (local agent)
curl -sS --cacert /etc/ssl/consul/ca.pem https://127.0.0.1:8500/v1/status/leaderOps
問題 1
Your existing production already runs a solid Consul cluster spread across 3 AZs with ACLs and mTLS enabled. You are adding Vault, can accept an external dependency, and want to accelerate the rollout in the short term. You will place one Vault node in each AZ with low-latency reachability to Consul. Which architecture choice is most appropriate?
正解: A
The requirements are to leverage the existing solid Consul cluster and accelerate the rollout, plus low-latency reachability is in place. Consul storage with a least-privilege token and mTLS is the right fit. B assumes a dual-write that Vault does not support. C cannot provide HA. D has the backup procedure wrong (Raft backups happen on the Vault side).
What happens to Vault when Consul goes down?
Vault can no longer read or write its storage and cannot elect a leader. Lease validation and renewal, plus most operations, will fail. Monitor Consul health alongside Vault, run a redundant Consul cluster (an odd number of servers), and have a fast recovery runbook ready.
Do I also need to enable data encryption on the Consul side?
Vault encrypts data before writing it, so at-rest encryption on Consul is not strictly required. However, mTLS for transport and ACL-based access control on Consul are mandatory. Depending on your audit requirements, you may also enable disk encryption on Consul.
I have heard this setup is latency-sensitive. What are the practical mitigations?
Run a local Consul agent on every Vault node and keep the agent-to-server hop low-latency. Avoid WAN hops, run 3-5 Consul servers (an odd number), and provision adequate CPU and I/O. Do not casually change session/lock defaults; verify any tuning through load tests first.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...