Patroni
Commands
Get cluster status:
Get cluster config:
Edit cluster config:
Failover to a replica:
patronictl failover \
--master={current-master}
--candidate={candidate}
Switchover to a replica:
patronictl switchover \
--master={current-master}
--candidate={candidate}
Restart a member:
patronictl restart {cluster} {member}
Reinit a member:
patronictl reinit {cluster} {member}
API
Get endpoint status:
curl -s http://localhost:8008/patroni | jq .
Get cluster status:
curl -s http://localhost:8008/cluster | jq .
Get event history:
curl -s http://localhost:8008/history | jq .
Get config:
curl -s localhost:8008/config | jq .
Failover to a replica:
curl -XPOST -s http://localhost:8009/failover -d '{"candidate":"{candidate}"}'