Re:Spilo: High Availability PostgreSQL cluster using Docker
by ko_pivot on Wednesday June 12, 2024 @11:41AM
(#40659363)
Very cool. How does failover work? I see that Spilo expects a standard load balancer in front of the cluster, but that load balancer won’t be able to track who the writer instance is on its own.
[ Parent
| on HN ]
Re:Spilo: High Availability PostgreSQL cluster using Docker
by bambambazooka on Wednesday June 12, 2024 @12:53PM
(#40660252)
You can put HAProxy in front with a write- and a read-frontend with a backend each and all servers in the backend. To determine which server is a write instance or a standby you can provide a `external-check command` to the backends. That command can be a bash script, that connects to the server and executes `SELECT pg_is_in_recovery();`.