Skip to content

HOWTO: Execute a PostgreSQL Failover with Patroni

The PostgreSQL HA reference scenario places planned switchover and primary-failure response behind one rehearsed, reviewable HybridOps operation. This HOWTO covers both Patroni-managed paths, captures before-and-after cluster state, confirms replica promotion and application reconnection, and produces the structured run record used by the DR lifecycle.

What this covers:

  • Controlled switchover via patronictl switchover: pre-checks, execution, and timing measurement
  • Emergency failover path: detecting primary loss, triggering failover, and confirming new leader
  • Before/after run-record capture: Patroni cluster state, replication lag, and application connectivity

Learn this in Academy: Disaster Recovery Automation track