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?


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.

| improve this answer | |
  • 1
    How long it take effect ? i removed thatn file and see no difference – Tai Tran Mar 10 at 23:52

Answer to a similar question : http://www.sraoss.jp/pipermail/pgpool-general/2017-May/005504.html

The relevant answer being:

Pgpool-II chooses one of DB nodes with a probability of the weight parameter when a client connects to Pgpool-II. "load_balance_node" is true if it is chosen, and false if it is not chosen. The decision is not relevant whether it is a master or a slave.

| improve this answer | |
  • My problem is pgpool never choose slave. The field "status" is "unused" and slave doesn't get any postgres traffic – abr_stackoverflow Dec 8 '17 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.