A Stronghold HA cluster with Raft storage is upgraded one node at a time. Standby nodes are upgraded first; then the active node hands over its role to one of the upgraded nodes and is upgraded last. This order keeps the quorum and the cluster available during the upgrade.
Preparation
Prepare the cluster and the new binary before the upgrade:
Read the release notes for all versions between the current and target ones. Pay attention to configuration changes and breaking changes.
Check the cluster version and state:
d8 stronghold status d8 stronghold operator raft list-peers d8 stronghold operator raft autopilot stateAll nodes must be
voter, and Autopilot must reportHealthy: true.Take a storage snapshot and inspect it (see Creating a snapshot and Inspecting a snapshot):
d8 stronghold operator raft snapshot save pre-upgrade.snap d8 stronghold operator raft snapshot inspect pre-upgrade.snapBack up the configuration file, systemd unit, and current binary on each node:
cp -a /opt/stronghold/stronghold /opt/stronghold/stronghold.bak cp -a /opt/stronghold/config.hcl /opt/stronghold/config.hcl.bak cp -a /etc/systemd/system/stronghold.service /etc/systemd/system/stronghold.service.bakIf Shamir seal is used, make sure unseal key holders are available: every node must be unsealed after a restart.
Copy the new binary to all nodes, for example to
/tmp/stronghold, and check its version:/tmp/stronghold versionIdentify the active node: in the
d8 stronghold operator raft list-peersoutput, its state isleader.
Upgrading standby nodes
Perform the steps on each standby node in turn. Do not move to the next node until the current one has rejoined the cluster.
Replace the binary:
install -o root -g root -m 0755 /tmp/stronghold /opt/stronghold/strongholdRestart the service:
systemctl restart strongholdIf Shamir seal is used, unseal the node. Point to the node being upgraded:
export STRONGHOLD_ADDR=https://raft-node-2.demo.tld:8200 d8 stronghold operator unsealCheck that the node has rejoined the cluster and is unsealed:
d8 stronghold status d8 stronghold operator raft autopilot stateWait until Autopilot shows the node as
healthyand the cluster asHealthy: true.Check the node server logs for errors:
journalctl -u stronghold.service --since "10 minutes ago"
Upgrading the active node
Upgrade the active node after all standby nodes are upgraded:
Hand over the active role to one of the upgraded nodes. Run the command against the current active node:
export STRONGHOLD_ADDR=https://raft-node-1.demo.tld:8200 d8 stronghold operator step-downMake sure another node has become the leader:
d8 stronghold operator raft list-peersUpgrade the former active node the same way as standby nodes: replace the binary, restart the service, unseal the node, and wait until it rejoins the cluster.
Post-upgrade checks
After all nodes are upgraded, check the cluster:
Check the version on each node:
for node in raft-node-1 raft-node-2 raft-node-3; do STRONGHOLD_ADDR=https://${node}.demo.tld:8200 d8 stronghold status | grep -E 'Version|HA Mode|Sealed' doneCheck the cluster state:
d8 stronghold operator raft list-peers d8 stronghold operator raft autopilot stateCheck the main scenarios: login via the auth methods in use, reading and writing a test secret, issuing dynamic credentials.
Check that metrics and alerts work (see Monitoring).
The autopilot state output shows each node version (Version), which lets you confirm that all nodes are upgraded.
Rollback
If a node fails to start after the upgrade or the cluster misbehaves:
- Stop the upgraded node and restore the previous binary from
/opt/stronghold/stronghold.bak. - If the new version has already modified the storage data and the previous version does not start, restore the cluster from the
pre-upgrade.snapsnapshot on the previous version (see Restoring from a snapshot).
Restoring from a snapshot returns data to the moment the snapshot was taken. Changes made after the snapshot are lost.