<div dir="ltr"><div>Hello Tatsuo,<br><br></div><div>After reviewing one more time, I&#39;ve seen that my third node missed the parallel_mode=1,<br><br></div><div>Now I can see it up and as secondary, but I can see that not all my nodes have load_balance_node to true, I don&#39;t know if this is normal ?<br><br># show pool_nodes;<br> node_id | hostname  | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay<br>---------+-----------+------+--------+-----------+---------+------------+-------------------+-------------------<br> 0       | 10.0.0.58 | 5433 | up     | 0.333333  | primary | 0          | false             | 0<br> 1       | 10.0.0.59 | 5433 | up     | 0.333333  | standby | 0          | false             | 0<br> 2       | 10.0.0.36 | 5433 | up     | 0.333333  | standby | 0          | true              | 0<br><br></div><div>Thank you.<br></div><div>Best regards,<br></div><div>Mathieu<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 7, 2016 at 6:43 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It seems there&#39;s something wrong in you pgpool.conf (especially<br>
in the backend.. section). Can you show us pgpool.conf?<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
<div class="HOEnZb"><div class="h5"><br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m trying to deploy a high availability setup with PostgreSQL 9.6 and<br>
&gt; PgPool 3.6.0.<br>
&gt; Everything was working fine up to the second host, I could get queries load<br>
&gt; balanced (I use streaming replication)<br>
&gt;<br>
&gt; But then I wanted to add a 3rd backend to I can have more read load<br>
&gt; balancing (1 master streaming to 2 replicas), so I just took a snapshot of<br>
&gt; the first replica and created another instance of it as second replica, it<br>
&gt; can connect without problem to the master and start replicating.<br>
&gt;<br>
&gt; I duplicated the configuration I have in pgpool from the first replica to<br>
&gt; the second one, also added it to the list of the backends in<br>
&gt; trusted_servers.<br>
&gt;<br>
&gt; But then, since, I can&#39;t get it to leave the &quot;unused&quot; state :<br>
&gt;<br>
&gt; # show pool_nodes;<br>
&gt;  node_id | hostname  | port | status | lb_weight |  role   | select_cnt |<br>
&gt; load_balance_node | replication_delay<br>
&gt; ---------+-----------+------+-<wbr>-------+-----------+---------+<wbr>------------+-----------------<wbr>--+-------------------<br>
&gt;  0       | 10.0.0.58 | 5432 | up     | 0.333333  | primary | 145        |<br>
&gt; false             | 0<br>
&gt;  1       | 10.0.0.59 | 5432 | up     | 0.333333  | standby | 11         |<br>
&gt; true              | 0<br>
&gt;  2       | 10.0.0.36 | 5432 | unused | 0.333333  | standby | 0          |<br>
&gt; false             | 0<br>
&gt;<br>
&gt; Here you can see my issue in node 2.<br>
&gt; When doing tcpdump or netstats, I can also see that there is not<br>
&gt; connections from the pgpool to the postgresql on port 5432, but I can see a<br>
&gt; ping coming from the pgpool to this server, the others servers have active<br>
&gt; connections :<br>
&gt;<br>
&gt; root@gc-lab-pgsql-1:~# netstat -anp | grep 10.0.0.57<br>
&gt; tcp        0      0 <a href="http://10.0.0.58:5432" rel="noreferrer" target="_blank">10.0.0.58:5432</a>          <a href="http://10.0.0.57:41323" rel="noreferrer" target="_blank">10.0.0.57:41323</a><br>
&gt; ESTABLISHED 878/main: mathieu<br>
&gt; tcp        0      0 <a href="http://10.0.0.58:5432" rel="noreferrer" target="_blank">10.0.0.58:5432</a>          <a href="http://10.0.0.57:39822" rel="noreferrer" target="_blank">10.0.0.57:39822</a><br>
&gt; ESTABLISHED 31799/main: mathieu<br>
&gt; tcp        0      0 <a href="http://10.0.0.58:5432" rel="noreferrer" target="_blank">10.0.0.58:5432</a>          <a href="http://10.0.0.57:39864" rel="noreferrer" target="_blank">10.0.0.57:39864</a><br>
&gt; ESTABLISHED 31841/main: mathieu<br>
&gt;<br>
&gt; root@gc-lab-pgsql-2:~# netstat -anp | grep 10.0.0.57<br>
&gt; tcp        0      0 <a href="http://10.0.0.59:5432" rel="noreferrer" target="_blank">10.0.0.59:5432</a>          <a href="http://10.0.0.57:42897" rel="noreferrer" target="_blank">10.0.0.57:42897</a><br>
&gt; ESTABLISHED 23707/main: mathieu<br>
&gt; tcp        0      0 <a href="http://10.0.0.59:5432" rel="noreferrer" target="_blank">10.0.0.59:5432</a>          <a href="http://10.0.0.57:44398" rel="noreferrer" target="_blank">10.0.0.57:44398</a><br>
&gt; ESTABLISHED 25526/main: mathieu<br>
&gt; tcp        0      0 <a href="http://10.0.0.59:5432" rel="noreferrer" target="_blank">10.0.0.59:5432</a>          <a href="http://10.0.0.57:42939" rel="noreferrer" target="_blank">10.0.0.57:42939</a><br>
&gt; ESTABLISHED 23748/main: mathieu<br>
&gt;<br>
&gt; root@gc-lab-pgsql-3:~# netstat -anp | grep 10.0.0.57<br>
&gt; &lt;Nothing&gt;<br>
&gt;<br>
&gt; Weird thing, I can see  the node 2 in the pool_pools<br>
&gt;<br>
&gt;<br>
&gt; # show pool_pools;<br>
&gt;  pool_pid |     start_time      | pool_id | backend_id | database |<br>
&gt; username |     create_time     | majorversion | minorversion | pool_counter<br>
&gt; | pool_backendpid | pool_connected<br>
&gt; ----------+-------------------<wbr>--+---------+------------+----<wbr>------+----------+------------<wbr>---------+--------------+-----<wbr>---------+--------------+-----<wbr>------------+----------------<br>
&gt;  5307     | 2016-11-25 10:22:28 | 0       | 0          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;  5307     | 2016-11-25 10:22:28 | 0       | 1          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;  5307     | 2016-11-25 10:22:28 | 0       | 2          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;  5307     | 2016-11-25 10:22:28 | 1       | 0          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;  5307     | 2016-11-25 10:22:28 | 1       | 1          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;  5307     | 2016-11-25 10:22:28 | 1       | 2          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;  5307     | 2016-11-25 10:22:28 | 2       | 0          |<br>
&gt; |          |                     | 0            | 0            |<br>
&gt; 0            | 0               | 0<br>
&gt;<br>
&gt;<br>
&gt; I can&#39;t find why, node 1 and 2 have exactly the same configuration, and in<br>
&gt; everything is the same in my pgpool configuration about those 2 nodes.<br>
&gt;<br>
&gt; I ran pgbench in both write and read on the pgpool, and connections to node<br>
&gt; 2 are never used.<br>
&gt;<br>
&gt; How can I troubleshoot that ? I could not find anything interesting in the<br>
&gt; logs.<br>
&gt;<br>
&gt; Thank you.<br>
&gt; Mathieu<br>
</div></div></blockquote></div><br></div>