LINUXOR.SK ... open source notes ...

Vault - snapshot.json (Raft snapshot agent)

category: solutionz · date: 2024-12-31 · updated: 2026-10-02 · author: LALA

Vault Solution · Config document · referenced from Raft snapshots, backup and restore

noteThis file holds an AppRole SecretID and S3 keys in clear text. On the hosts it was readable by the vault user only; here every secret is a placeholder.

Configuration of the third-party Raft snapshot agent that ran beside every Vault node. The agent asks the local node whether it is the leader, and only the leader takes a snapshot and uploads it. This is the final form, writing straight to S3-compatible object storage.

ItemValue
Path on the host/etc/vault.d/snapshot.json
Ownervault:vault
Deployed onall Vault nodes
Read byvault_raft_snapshot_agent 0.3.1

The file

json
{
   "addr":"http://127.0.0.1:8200",
   "retain":9223372036854775807,
   "frequency":"7200s",
   "role_id":"<APPROLE_SNAPSHOTS_ROLE_ID>",
   "secret_id":"<APPROLE_SNAPSHOTS_SECRET_ID>",
   "aws_storage":{
      "access_key_id":"<S3_ACCESS_KEY_ID>",
      "secret_access_key":"<S3_SECRET_ACCESS_KEY>",
      "s3_region":"dc1",
      "s3_bucket":"prod-vault",
      "s3_key_prefix":"snapshots",
      "s3_endpoint":"https://s3-a.example.net",
      "s3_force_path_style":true
   }
}

Settings

KeyValue as builtMeaning
addrhttp://127.0.0.1:8200The loopback listener of the local node, no TLS
retain9223372036854775807Number of snapshots to keep; the largest 64-bit integer, so the agent never deleted anything and retention was left to the storage
frequency7200sA snapshot every two hours
role_id, secret_idplaceholdersAppRole snapshots, bound to snapshots-policy
s3_key_prefixsnapshotsDirectory inside the bucket
s3_force_path_styletrueNeeded by most S3-compatible stores

Earlier forms

PeriodStorage blockretainfrequency
First deployment, PROD and NONPROD"local_storage": {"path": "/data/raft/snapshots"}1687200s
First deployment, COMMON"local_storage": {"path": "/data/raft/snapshots"}141d
Finalaws_storage as shownunlimited7200s

Checked against Vault 2.1

See the raft operator commands.

← solutionz