- Reviewing the current configuration
- Generating a new encryption key
- Distributing the key across the cluster
- Promoting the new key to primary
- Removing the old key
1. Review Current Configuration
Inspect your existing gossip encryption key inconsul.d/config.hcl:
Before you begin, back up your Consul configuration and data directory. This ensures you can recover quickly if something goes wrong.
2. Generate a New Gossip Encryption Key
Run the following command on any Consul server or client to create a fresh base64-encoded key:3. Distribute the New Key Across the Cluster
Install the newly generated key into the cluster keyring:3.1. Verify Key Distribution
On another node, list installed keys:4. Promote the New Key to Primary
Switch the cluster’s primary gossip encryption key:5. Remove the Old Encryption Key
Once every node is using the new key, remove the old one:Do not remove the old key until all nodes report the new key as primary. Premature removal can lead to cluster partitions and service disruptions.