0

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?

bumped to the homepage by Community 8 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

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

  • This answer might be improved by a "how-to" based on what's in the link. Link-only answers are not really considered the best form of answer here. – Vérace May 2 at 16:52
  • Sure, I'll get an example up here soon.. – Dave Cook May 6 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.