WIUNIX ACADEMY
PostgreSQL with Patroni: replication, quorum and safe switchover
Page 6 of 6. Review the earlier steps and prerequisites before continuing.
YOUR SYSTEM. YOUR STEPS.
Where are you working?
Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.
USE YOUR OWN VALUES
Configure this tutorial
Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.
Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.
Set values for my environment11 editable values
LET’S BUILD
Stop the lab without deleting evidence
Stop writers first. On all three VMs stop the dedicated Patroni unit, then the dedicated etcd unit. Do not stop or unmask vendor units on a host with other services. No deletion command is supplied. Retain data/config/logs privately until the recovery review is finished; configs contain passwords and keys remain protected. These units were not enabled for boot; boot persistence and reboot behavior are not tested. For production, resolve fencing, off-host backup/PITR, endpoint routing, TLS rotation, resource/storage monitoring and OS-specific lifecycle tests before enabling anything.
Disposable database VM; Bash as administrator
sudo systemctl stop academy-pg-patroni.service
sudo systemctl stop academy-pg-etcd.service
sudo systemctl is-active academy-pg-patroni.service academy-pg-etcd.service || true
sudo ss -lntup
Only lab-owned services stopped; data, keys and configs retained privately.
GO TO THE SOURCE
Official references
Each environment states how it was reviewed. A documentation review does not claim a hands-on test of every version.
- PostgreSQL18 release notes
- Ubuntu PGDG packages
- Debian PGDG packages
- Physical streaming replication and slots
- Client certificate verification
- Host authentication rules
- PITR and continuous archiving
- pg_rewind requirements and risks
- Patroni replication modes
- Patroni YAML configuration
- Patroni security
- Watchdog and split brain
- etcd3.7.2 release
- etcd transport security
- etcd clustering
- etcd authentication
- Ubuntu Python versions
KEEP LEARNING