pg_auto_failover monitors PostgreSQL databases and automatically manages failover to maintain high availability. Built on PostgreSQL native features for zero data loss.
pg_auto_failover is a service that monitors and manages failover for PostgreSQL. It coordinates replication between primary and secondary nodes and automatically promotes a standby when the primary fails.
# From source
git clone https://github.com/hapostgres/pg_auto_failover.git
cd pg_auto_failover
make
pg_auto_failover is also available as a package in many distributions.
# Create a formation
pg_autoctl create formation --formation ha --kind postgres --num-sync-standby 1
Add nodes
pg_autoctl create node –hostname node1 –name node1
pg_autoctl create node –hostname node2 –name node2
Get professional support and maintenance for pg_auto_failover in your production environment.