0

I am using docker containers bitnami/postgresql-repmgr:13.3.0-debian-10-r22 in order to enable automatic failover for PostgreSql (I have 2 containers on 2 servers, one is the primary, the other a standby).

Our application (using springboot) is using this connection string for the Postgres replication:

postgres.host=xx.xx.x.140 postgres.port=1054

postgres.cluster=[xx.xx.x.140:5433 (http://xx.xx.x.140:5433)],[xx.xx.x.97:5433(http://xx.xx.x.97:5433)]

In case the Primary (140) fails, and repmgr will make 97 the primary, the application will try to connect to 140, will fail, and so will try the next string in the connection string, and will connect successfully to the new primary 97.

However, when I start the failed primary as standby, the application can connect to it, and does so, but returns errors on "read only".

I was thinking of using pgbouncer to overcome this problem, but I am not sure how and if it can be integrated into the repmgr container.

Anyone tried this combination?

Thanks

Tamar
  • 145
  • 4
  • 15

0 Answers0