PostgreSQL does not include automatic failover out of the box.
When the primary goes down, someone has to promote the standby manually — which means downtime.
repmgr adds an automatic failover daemon (repmgrd) that monitors the cluster and promotes the standby within seconds when the primary fails.
This guide walks through setting up a two-node PostgreSQL 18 cluster with streaming replication and automatic failover on Ubuntu 24.04, using repmgr 5.x.
Every step has been run live on a real cluster and the output verified.
Laboratoire de sauvegarde et de récupération PostgreSQL 18 sur Ubuntu 24.04 — pg_dump, pg_basebackup et pgBackRest
Si vous travaillez avec PostgreSQL en production, les sauvegardes ne sont pas facultatives.
Dans ce laboratoire, j'ai mis en place un environnement complet de sauvegarde et de restauration PostgreSQL 18 sur Ubuntu 24.04 et testé les trois principales approches de sauvegarde :
- sauvegardes logiques avec
pg_dump - sauvegardes physiques avec
pg_basebackup - sauvegardes de niveau production avec pgBackRest, y compris l'archivage des WAL et la récupération à un instant T (PITR)
Tout a été testé sur une vraie VM avec des exercices de récupération réels — pas des simulations.
Continuer la lecture “PostgreSQL 18 Backup & Recovery Lab on Ubuntu 24.04 — pg_dump, pg_basebackup and pgBackRest”