Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc...
by geoka9 on Friday April 14, 2017 @03:50PM
(#14116742)
But writes need to be directed to the master, right? Or Patroni is smart enough to do it by itself?
Re:Patroni: A Template for PostgreSQL HA with ZooKeeper, Etc...
by CyberDem0n on Friday April 14, 2017 @04:06PM
(#14116859)
Correct. Writes need to be directed to master. May be not only writes but some reads as well. Only application can know which statement can be executed on replicas and which must be executed on master.
In the HAProxy config file you just need to list all Patroni nodes, specify a health-check and it will do a load-balancing for you.
The same approach works for example with AWS ELB.