DBAtlas · Database operations atlas

Put Patroni into maintenance mode and back (pause/resume)

PostgreSQLPatroni

Command

# Maintenance mode: automatic failover and Patroni's control over PostgreSQL stop
patronictl -c /etc/patroni/patroni.yml pause <cluster> --wait
patronictl -c /etc/patroni/patroni.yml list <cluster>          # should show 'Maintenance mode: on'
# ... maintenance work (e.g. manual PostgreSQL restart, DCS maintenance) ...
patronictl -c /etc/patroni/patroni.yml resume <cluster> --wait

What it does

Puts the cluster in maintenance mode: Patroni performs no automatic failover and does not restart a stopped PostgreSQL; resume returns to normal management.

When to use it

During DCS (etcd/Consul) maintenance, Patroni upgrades, or when PostgreSQL must be managed manually without Patroni interfering.

Caution

If the primary crashes while paused there is no automatic failover and the outage continues. Do not forget to resume after maintenance; add a 'Maintenance mode' check to your alerting. Manually starting a PostgreSQL as primary while paused can cause split-brain.

Open in DBAtlas →

Related