[pgpool-general: 6459] Re: Load balancing and unused status

Fernando Luizão fernandoluizao at gmail.com
Fri Mar 15 04:12:36 JST 2019


Thanks, now the standby is up.

But I'm not sure if I understand the balancing rules.

What I would like is for the consultations to be divided more evenly.
I tried to test the load balancing by opening several psql's on my local
machine and doing queries on each of them, but it looks like the queries
are always being routed to the standby now ...

The docs says:

To which node the load balancing mechanism sends read queries is decided at
the session start time and will not be changed until the session ends.

Does this mean that every query will be directed to the same node, until
there is a write operation, on connection basis?

Thanks,
Fernando

On Thu, Mar 14, 2019 at 3:36 PM Pierre Timmermans <ptim007 at yahoo.com> wrote:

> For some reason the status is unused, it should be up or down.
>
> I think you should stop pgpool, remove the file /tmp/pgpool_status, then
> restart pgpool. The file /tmp/pgpool_status is used by pgpool to record the
> status of the node. When the file is not there it will create it at startup
>
> Regards,
>
> Pierre
>
>
> On Thursday, March 14, 2019, 7:32:04 PM GMT+1, Fernando Luizão <
> fernandoluizao at gmail.com> wrote:
>
>
> Hi,
>
> I'm new to pgpool, and I'm trying to use the load balancer.
> I have a primary and a hot standby, using native streaming replication.
>
> Versions:
> postgresql - 11.2
> pgpool - 4.0.2
>
> Here's what I changed in pgpool.conf:
>
> listen_addresses = '*'
> port = 5432
>
> backend_hostname0 = '192.168.51.186'
> backend_port0 = 5433
> backend_weight0 = 0.4
> backend_data_directory0 = '/var/lib/postgresql/11/main'
> backend_flag0 = 'ALWAYS_MASTER'
>
> backend_hostname1 = '192.168.51.185'
> backend_port1 = 5433
> backend_weight1 = 0.6
> backend_data_directory1 = '/var/lib/postgresql/11/main'
>
> load_balance_mode = on
>
> master_slave_mode = on
> master_slave_sub_mode = 'stream'
>
> However, when I inspect the nodes on pgpool, I get the following:
>
> postgres=# show pool_nodes;
>  node_id |    hostname    | port | status | lb_weight |  role   |
> select_cnt | load_balance_node | replication_delay | last_status_change
>
> ---------+----------------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
>  0       | 192.168.51.186 | 5433 | up     | 0.400000  | primary | 6113
>    | true              | 0                 | 2019-03-14 11:39:15
>  1       | 192.168.51.185 | 5433 | unused | 0.600000  | standby | 0
>   | false             | 0                 | 2019-03-14 11:39:15
>
> All queries are being redirected to primary. I can query the standby
> directly, so everything seems fine with my replication setup.
>
> Why it says the standby is unused? I'm missing something in the
> configuration?
>
> Thanks,
> Fernando
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20190314/b3bf346d/attachment.html>


More information about the pgpool-general mailing list