Thread: High Availability, guarantee to use sync nodes

High Availability, guarantee to use sync nodes

From
Dirk Krautschick
Date:

Hi all,

 

if there are several PostgreSQL nodes replicating synchronous and I configure a guarantee that

for example 3 of 5 nodes have to be in sync to go on with synchronous_standby_names and

now I want to implement a load balancing scenario with active standby DBs…how or with what

tool can I achieve that my read clients only use sync nodes. For sure somehow a check in the

pg_stat_replication before is possible but is there something in parameters or with solutions

like repmgr, patroni, etc. to do this?

 

Thanks and best regards

 

Dirk

Re: High Availability, guarantee to use sync nodes

From
Maksim Milyutin
Date:

On 31.08.2020 14:06, Dirk Krautschick wrote:

Hi all,


Hi

 

if there are several PostgreSQL nodes replicating synchronous and I configure a guarantee that

for example 3 of 5 nodes have to be in sync to go on with synchronous_standby_names and

now I want to implement a load balancing scenario with active standby DBs…how or with what

tool can I achieve that my read clients only use sync nodes. For sure somehow a check in the

pg_stat_replication before is possible but is there something in parameters or with solutions

like repmgr, patroni, etc. to do this?


For such tools as patroni or stolon the list of sync replicas could be got from DCS storage (etcd, consul, etc). Your application or some proxy, e.g. haproxy with confd, might extract the list of sync nodes, subscribe on changes in KV entry that stores this list and routes queries according it.


-- 
Regards,
Maksim Milyutin