I've enabled streaming replication in my postgres 9.5.10 installed from ubuntu xenial repo. I want to enable load balance for pgpool-2 (3.7.0 amefuriboshi) installed from sources. So I have this pgpool.conf: https://pastebin.com/qWWgejQN
As you can see, I set both nodes, turned off replication, turned on master/slave mode and set it to stream. And also I enabled memcached caching.
Now I have very big problem that pgpool doesn't want to use slave for balancing:
postgres=# show pool_nodes;
node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+----------------+------+--------+-----------+---------+------------+-------------------+-------------------
0 | localhost | 5433 | up | 0.500000 | primary | 0 | true | 0
1 | host2 | 5433 | unused | 0.500000 | standby | 0 | false | 0
(2 rows)
What am I do wrong?
Best Answer
I found this page http://lists.pgfoundry.org/pipermail/pgpool-general/2010-May/002711.html
They say that I need to remove file pgpool_status. I did it and pgpool works now with two nodes! Seems the file was created when I had not the second node and after pgpool just trusted this file all time. So removing this file solved the problem.