[pgpool-general: 4244] Re: Load balancing in master slave not working, backends stanby status 0
Roman Barczyński
rombar at gmail.com
Fri Nov 27 22:54:18 JST 2015
Nevermind,
somehow I found that if "show pool_nodes;" gives status 0 you can *manually*
bring it to status2 by:
pcp_attach_node 1 localhost 9898 login pass <node_id>
It'd be nice if documentation mentioned, that if you have for whatever
reason status 0 just use pcp_attach_node.
It doesn't and it is not as obvious as it seems.
regards
RB
Roman Barczyński
On Fri, Nov 27, 2015 at 1:52 PM, Roman Barczyński <rombar at gmail.com> wrote:
> Hello,
>
> I can't make load balancing to work, all queries are sent to backend0
> (primary), even if I set very small weight:
>
> $ psql -h pgpool -c "show pool_nodes;" -n
> node_id | hostname | port | status | lb_weight | role
> ---------+------------+------+--------+-----------+---------
> 0 | 10.0.0.1 | 5432 | 2 | 0.000500 | primary
> 1 | 10.0.0.2 | 5432 | 0 | 0.499750 | standby
> 2 | 10.0.0.3 | 5432 | 0 | 0.499750 | standby
>
> Each node is accesible and if I swap backend_host0 for second IP every
> query is sent to it. Additionally primary node is not detected when its IP
> is in backend_host1 or backend_host2:
>
> $ psql -h pgpool -c "show pool_nodes;" -n
> node_id | hostname | port | status | lb_weight | role
> ---------+------------+------+--------+-----------+---------
> 0 | 10.0.0.2 | 5432 | 2 | 0.000500 | standby
> 1 | 10.0.0.1 | 5432 | 0 | 0.499750 | standby
> 2 | 10.0.0.3 | 5432 | 0 | 0.499750 | standby
>
>
> My config:
>
> listen_addresses = '*'
> port = 5432
> pcp_port = 9898
>
> backend_hostname0 = '10.0.0.1'
> backend_port0 = 5432
> backend_weight0 = 1
>
> backend_hostname1 = '10.0.0.2'
> backend_port1 = 5432
> backend_weight1 = 1000
>
> backend_hostname2 = '10.0.0.3'
> backend_port2 = 5432
> backend_weight2 = 1000
>
> enable_pool_hba = on
> pool_passwd = 'pool_passwd'
>
> ssl = off
> num_init_children = 32
> max_pool = 4
> child_life_time = 300
> child_max_connections = 0
> connection_life_time = 0
> client_idle_limit = 0
>
> connection_cache = off
> reset_query_list = 'ABORT; DISCARD ALL'
>
> replicate_select = off
>
> master_slave_mode = on
> master_slave_sub_mode = 'stream'
> sr_check_period = 0
> sr_check_user = 'replica_test'
> sr_check_password = 'replica_test'
> delay_threshold = 0
>
> wd_lifecheck_query = 'SELECT 1'
> wd_lifecheck_dbname = 'template1'
> wd_lifecheck_user = 'replica_test'
> wd_lifecheck_password = 'replica_test'
>
> load_balance_mode = on
> ignore_leading_white_space = on
> white_function_list = ''
> black_function_list = 'nextval,setval'
>
> Any advice?
>
> Roman Barczyński
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20151127/b901ac22/attachment.htm>
More information about the pgpool-general
mailing list