I'm not having a problem yet, just searching for advise
I want to build installation of PostgreSQL on 3 nodes using patroni
: master and 2 standbys (for failover only). There are PostgreSQL and pgbouncer
on each node with same configuration. All applications connect to PostgreSQL via pgbouncer
If PostgreSQL becomes dead, patroni
automatically promotes on of the standbys as new master and everything just works fine. But if pgbouncer
becomes dead nothing will happen
Is there any good way to make patroni
watch pgbouncer
(like it is doing for PostgreSQL) or I shouldn't use patroni
for this case? What should I use?
I'm really not sure that it is what I want (cause pgbouncer
is pretty stable), but here is my considerations:
– If pgbouncer
becomes dead, entire node becomes useless for applications. So from application point of view it is the same as PostgreSQL becomes dead
– I don't really care about type of failure, even if pgbouncer
restart could fix everything, so standby promotions suits me well
How do I suppose to solve problems like this?
Best Answer
Yes, you can use Consul templates for this. https://github.com/hashicorp/consul-template This will notify pgbouncer that Patroni has elected a new master. Cheers, Dave