[pgpool-general: 8484] Re: disable load balancing to a master/slave cluster with streaming replication
Bo Peng
pengbo at sraoss.co.jp
Mon Nov 7 22:41:35 JST 2022
Hello,
> I setup a master/slave configuration with postgresql 14, and I would like
> to send all read queries to the slave and all write statements to master. I
> enabled load balancing and specified backend_weight equal 0 for the master
> and 1 for the slave. Now, when clients connect and issue a write statement,
> they get errors about the postgresql being in read only. So, I think, these
> statements were sent to the slave machine.
>
> How should I change the load balancer (or other) parameters in order to
> solve this problem?
If you are using streaming replication mode,
and you are setteing backend_weight0 = 0 and backend_weight1 = 1,
Pgpool-II should send all read queries to standby and write queries to primary.
Which version of Pgpool-II are you using?
How did you set the parameter "backend_clustering_mode"?
Regards,
On Mon, 07 Nov 2022 13:40:25 +0100
Giuseppe Sacco <giuseppe at sguazz.it> wrote:
> Hello,
> I setup a master/slave configuration with postgresql 14, and I would like
> to send all read queries to the slave and all write statements to master. I
> enabled load balancing and specified backend_weight equal 0 for the master
> and 1 for the slave. Now, when clients connect and issue a write statement,
> they get errors about the postgresql being in read only. So, I think, these
> statements were sent to the slave machine.
>
> How should I change the load balancer (or other) parameters in order to
> solve this problem?
>
> Thank you very much,
> Giuseppe
--
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS LLC
https://www.sraoss.co.jp/
More information about the pgpool-general
mailing list