pg_auto_failover - High Availability Manager

Automatic Failover for PostgreSQL

pg_auto_failover monitors PostgreSQL databases and automatically manages failover to maintain high availability. Built on PostgreSQL native features for zero data loss.

Overview

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.

Key Features

  • Automatic failover: No manual intervention needed when primary fails
  • Zero data loss: Uses synchronous replication to ensure no data is lost
  • PostgreSQL native: Built on PostgreSQL's native streaming replication
  • Simple configuration: Easy to set up and maintain
  • Health monitoring: Continuous monitoring of both primary and standby

Architecture

  • PostgreSQL primary node
  • PostgreSQL standby node(s)
  • pg_auto_failover monitor (single node or cluster)
  • Automatic promotion of standby on primary failure

Installation

# 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.

Quick Example

# 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

Support Options

Get professional support and maintenance for pg_auto_failover in your production environment.