PostgreSQL repmgr with Keepalived Adding a Floating VIP

NASA Space Telescopes See Weather Patterns in Brown Dwarf

TL;DR: A repmgr cluster handles automatic failover — but applications still need to know which node is the current primary.

Keepalived solves this with a floating Virtual IP (VIP) that moves automatically to whichever node holds the primary role.

This guide adds a VIP to an existing PostgreSQL 18 + repmgr cluster on Ubuntu 24.04 using Keepalived 2.x.

Every step has been run live on a real cluster and the output verified.

Continue reading “PostgreSQL repmgr with Keepalived Adding a Floating VIP”

PostgreSQL repmgr Setup Replication with Automatic Failover

snow capped peaks of trentino alto adige

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.

Continue reading “PostgreSQL repmgr Setup Replication with Automatic Failover”