[pgpool-general: 8488] Re: disable load balancing to a master/slave cluster with streaming replication
Giuseppe Sacco
giuseppe at sguazz.it
Tue Nov 8 16:24:36 JST 2022
Il giorno mar, 08/11/2022 alle 14.58 +0900, Bo Peng ha scritto:
> Hello,
>
> > Il giorno lun, 07/11/2022 alle 13.40 +0100, Giuseppe Sacco ha scritto:
> > > 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.
> > [...]
>
> Are all write queries sent to the primary?
> Or just specific queries?
The problem is the other way around: the CREATE TABLE statements are sent to
the slave. Since that machine is in streaming replication, it is in read only
mode, and gives an error. I don't know if any write query is sent to the
primary. I am going to check.
> > How may I collect information about the way pgpool select the backend? Is
> > there any specific string I should look for in the log when running with
> > option -d? Does debug output include valuable information?
>
> If you enable "log_per_node_statement = on" to output the queries, it may
> help.
I am going to try. Thank you.
Bye,
Giuseppe
More information about the pgpool-general
mailing list