1

We have a 3 instance cluster in DC and a 3 instance cluster in DR as standby_cluster. For DC-DR real-time sync, we have added the DC cluster's leader's IP as standby_cluster IP in the DR patroni config. which is working fine and we are getting real-time syncing.

But in the case of changing DC leader internally, DR leader is not able to create a writable connection on the previous DC instance. and gets below error.

FATAL: could not connect to the primary server: could not make a writable connection to server "13.233.76.9:5432"

Can Anyone please help us for solving this issue? We are stuck on this issue for months.

For your reference:

pg_hba config:

TYPE DATABASE USER ADDRESS METHOD

local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust

local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust

host replication replicator 127.0.0.1/32 md5
host replication replicator 172.31.4.196/32 scram-sha-256
host replication replicator 172.31.2.237/32 scram-sha-256
host replication replicator 172.31.2.83/32 scram-sha-256
host replication replicator 172.31.45.26/32 scram-sha-256
host replication replicator 172.31.43.207/32 scram-sha-256
host replication replicator 172.31.42.188/32 scram-sha-256
host replication replicator 13.230.225.219/32 trust
host replication replicator 13.200.182.158/32 trust
host replication replicator 13.112.25.208/32 trust
host replication replicator 0.0.0.0/32 trust

DC Current Leader: 13.233.76.9 DC New Leader: 52.67.253.203 DR Leader: 13.230.225.219

Adelino Silva
  • 577
  • 3
  • 16
Rahi Shah
  • 11
  • 1

1 Answers1

0

An issue was opened REF: https://github.com/zalando/patroni/issues/2460 and is not done automatically. You have to put something stable to standby_cluster.host, e.g. hostname of load-balancer that always connects to the primary, Virtual IP, or maybe list all potential nodes of the source cluster there.

Adelino Silva
  • 577
  • 3
  • 16