<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:medium;"><div><div>Lucas,&nbsp;</div><div><br></div><div>this file is to protect you in the following scenario</div><div><br></div><div>1. pgpool is running, there are two backends</div><div>2. The master fails, pgpool initiate the failover and now the old master is down and the slave has become the new master</div><div>3. Someone restart the old master. At this point it is not a problem because pgpool has ejected it (marked it as down)</div><div>4. pgpool is stopped and restarted. Without the status file, pgpool cannot know that the old master was failed and that it must be excluded. So without the status file it would add it to the pool and you would have two masters.</div><div><br></div><div><br></div><div>Rgds, Pierre</div><div><br></div></div><div><br></div><div id="ydpa1d51583yahoo_quoted_5446403286" class="ydpa1d51583yahoo_quoted"><div>On Monday, May 15, 2017, 2:08:13 PM GMT+2, PVY &lt;balroga3@yandex.ru&gt; wrote:</div><div><div id="ydpa1d51583yiv9558506252">

<div>
<span style="font-family:'Courier New';font-size:10pt;">Hello Gabriel.<br>
<br>
You can also start pgpool with "-D" command-line option, it tells pgpool to discard the status file on startup.<br>
<br>
</span><table>
<tbody><tr>
<td width="2" bgcolor="#0000ff"><br>
</td>
<td><span style="font-family:'times new roman';font-size:11pt;color:#1f497d;">Hi Lucas,<br>
<br>
Thank you show much for your response, it works <span style="font-family:'wingdings';">⚐<br>
<br>
<span style="font-family:'times new roman';">In the status file before follow your sequence we can find the following values:<br>
up<br>
unused<br>
<br>
Once I have apply your suggested action plan now shows:<br>
up<br>
up<br>
<br>
Please can you let me know where I can get more details about the usage of this file, I can see on some documents that this file is it read during the start-up and I can see that the file it is not removed after the application shutdown (I do not know if it is the expected behavior).<br>
<br>
Regards<br>
<br>
<span style="color:#000000;"><b>From:</b> Lucas Luengas [mailto:lucasluengas@gmail.com] <br>
<b>Sent:</b> miércoles, 10 de mayo de 2017 20:09<br>
<b>To:</b> Gabriel Fernández Martínez &lt;gfernandez@hotelbeds.com&gt;<br>
<b>Cc:</b> pgpool-general@pgpool.net<br>
<b>Subject:</b> Re: [pgpool-general: 5445] FW: show pool_nodes status 0<br>
<br>
<span style="font-size:12pt;">Hello.<br>
<br>
I don't use your pgpool-II version. I am using pgpool-II version 3.4.6.<br>
<br>
You can check pgpool status file. With pgpool-II version 3.4.6 the file is /tmp/pgpool_status by default. Check configuration "logdir" in your pgpool.conf.<br>
<br>
You can try:<br>
- Stop pgpool.<br>
- Remove pgpool status file (/tmp/pgpool_status by default)<br>
- Start pgpool.<br>
- Check node status.<br>
<br>
Kind regards.<br>
<br>
<br>
On Tue, May 9, 2017 at 12:00 PM, Gabriel Fernández Martínez &lt;</span></span></span></span></span><a style="font-family:'times new roman';font-size:12pt;" href="mailto:gfernandez@hotelbeds.com" rel="nofollow" target="_blank">gfernandez@hotelbeds.com</a><span style="font-family:'times new roman';font-size:12pt;">&gt; wrote:<br>
Hi,<br>
<br>
I am evaluating if PgPool can be useful to support the business activity of one application. For testing purposes, I have deploy a 3.5.2 pgpool release on the same server where I am running the primary PostgresSQL 9.5.<br>
<br>
I had deployed a two PosgresSQL nodes using streaming replication and I am trying to configure the pgpool like a load balancer, but I am stuck with the configuration because the standby server it is in status <span style="color:#1f497d;">0<span style="color:#000000;"> and no selects are run on this server<br>
<br>
******-web=&gt; show pool_nodes;<br>
node_id | &nbsp; &nbsp; &nbsp; hostname &nbsp; &nbsp; &nbsp; | port | status | lb_weight | &nbsp;role &nbsp; | select_cnt<br>
---------+----------------------+------+--------+-----------+---------+------------<br>
0 &nbsp; &nbsp; &nbsp; | *************196.*** | 5<span style="color:#1f497d;">***<span style="color:#000000;"> | 2 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| primary | 0<br>
1 &nbsp; &nbsp; &nbsp; | *************198.*** | 5<span style="color:#1f497d;">***<span style="color:#000000;"> | 0 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| standby | 0<br>
(2 filas)<br>
<br>
I had used the template pgpool.conf.sample-stream and I have modify the following parameters to adapt to my environment:<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">listen_addresses = '*'<br>
<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_hostname0 = '**********196.***'<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_port0 = 5***<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_weight0 = 1<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_data_directory0 = '/data/******1'<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_flag0 = 'ALLOW_TO_FAILOVER'<br>
<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_hostname1 = '**********198.***'<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_port1 = 5***<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_weight1 = 1<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_data_directory1 = '/data/******2'<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">enable_pool_hba = on<br>
<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">logdir = '/var/log/pgpool-II-95'<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">pid_file_name = '/data/node1/pgpool-II-95/pgpool.pid'<br>
<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">sr_check_user = 'pgpool'<br>
-<span style="font-size:7pt;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size:12pt;">sr_check_password = '*********' <br>
<br>
I have created a user in the PostgreSQL cluster called pgpool and I have check that I can connect with this user to the Postgres database running on 196 &amp; 198 nodes.<br>
<br>
>From the pgpool startup output log, I can see that the primary it is properly identified, but no explanation about why the standby show a status 0:<br>
2017-05-08 18:05:05: pid 17334: LOG: &nbsp;pgpool-II successfully started. version 3.5.2 (ekieboshi)<br>
2017-05-08 18:05:05: pid 17334: LOG: &nbsp;find_primary_node: checking backend no 0<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;I am 17368<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;initializing backend status<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;pool_read: read 13 bytes from backend 0<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;authenticate kind = 5<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;pool_write: to backend: kind:p<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;pool_read: read 13 bytes from backend 0<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;authenticate kind = 5<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;pool_write: to backend: kind:p<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;pool_read: read 327 bytes from backend 0<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;authenticate kind = 0<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;authenticate backend: key data received<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;pool_read: read 327 bytes from backend 0<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;authenticate backend: transaction state: I<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;authenticate kind = 0<br>
2017-05-08 18:05:05: pid 17368: DEBUG: &nbsp;pool_write: to backend: kind:X<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;authenticate backend: key data received<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;authenticate backend: transaction state: I<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: extended:0 query:"SELECT pg_is_in_recovery()"<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;pool_write: to backend: kind:Q<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;pool_read: read 75 bytes from backend 0<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: kind: 'T'<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: received ROW DESCRIPTION ('T')<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: row description: num_fileds: 1<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: kind: 'D'<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: received DATA ROW ('D')<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: kind: 'C'<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: received COMMAND COMPLETE ('C')<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: kind: 'Z'<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;do_query: received READY FOR QUERY ('Z')<br>
2017-05-08 18:05:05: pid 17334: DEBUG: &nbsp;pool_write: to backend: kind:X<br>
2017-05-08 18:05:05: pid 17334: LOG: &nbsp;find_primary_node: primary node id is 0<br>
<br>
I have executed the pgbench to verify the load balancing between nodes and I can show that only the master is supporting load:<br>
<span style="color:#1f497d;">$ pgbench –h ********196.*** -p 9999 -c 10 -S -T 10 -U ******-web test<br>
Password:<br>
starting vacuum...end.<br>
transaction type: SELECT only<br>
scaling factor: 1<br>
query mode: simple<br>
number of clients: 10<br>
number of threads: 1<br>
duration: 10 s<br>
number of transactions actually processed: 218728<br>
latency average: 0.457 ms<br>
tps = 21871.048129 (including connections establishing)<br>
tps = 21879.150205 (excluding connections establishing)<br>
<br>
<span style="color:#000000;">******-web=&gt; show pool_nodes;<br>
node_id | &nbsp; &nbsp; &nbsp; hostname &nbsp; &nbsp; &nbsp; | port | status | lb_weight | &nbsp;role &nbsp; | select_cnt<br>
---------+----------------------+------+--------+-----------+---------+------------<br>
0 &nbsp; &nbsp; &nbsp; | *************196.*** | 5*** | 2 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| primary | 218560<br>
1 &nbsp; &nbsp; &nbsp; | *************198.*** | 5*** | 0 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| standby | 0<br>
(2 filas)<br>
<br>
<br>
I had configured the pcp management in order to be able to use pcp_node_info, and I got the same output (as expected):<br>
<br>
[postgres@********196 ~]$ pcp_node_info -U pgpool -h ip-10-222-64-196.ods --node=0 -v<br>
Password:<br>
Hostname: *******196.***<br>
Port &nbsp; &nbsp;: 5***<br>
Status &nbsp;: 2<br>
Weight &nbsp;: 0.500000<br>
[postgres@********196~]$ pcp_node_info -U pgpool -h ip-10-222-64-196.ods --node=1 -v<br>
Password:<br>
Hostname: ********198.***<br>
Port &nbsp; &nbsp;: 5322<br>
Status &nbsp;: 0<br>
Weight &nbsp;: 0.500000<br>
<br>
<br>
Any suggestion is welcome, I have try to go thought the documentation and I cannot find any clue who help me to resolve the issue.<br>
<br>
Best regards<br>
<br>
<span style="color:#cc0066;">Gabriel Fernández <br>
<span style="color:#5c5c5c;"><b>Technology <br>
</b>Architecture<br>
<br>
<span style="color:#1f497d;">tel: </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><a style="font-family:'times new roman';font-size:12pt;">(+34) 971 189 188</a><br>
<span style="font-family:'times new roman';font-size:12pt;color:#1f497d;">Ed. Mirall Cami de Son Fangos 100, B-2<br>
E-07007, Palma de Mallorca, Spain <br>
</span><a style="font-family:'times new roman';font-size:10pt;font-weight:bold;" href="mailto:gfernandez@hotelbeds.com" rel="nofollow" target="_blank">gfernandez@hotelbeds.com</a><br>
<br>
<a href="http://group.hotelbeds.com/" rel="nofollow" target="_blank"><img width="400" height="75" alt="" style="padding:1px;" src="cid:EBPkXrv2vOYLPei1FdFi"></a><br>
<br>
<br>
<span style="font-family:'times new roman';font-size:12pt;">_______________________________________________<br>
pgpool-general mailing list<br>
</span><a style="font-family:'times new roman';font-size:12pt;" href="mailto:pgpool-general@pgpool.net" rel="nofollow" target="_blank">pgpool-general@pgpool.net</a><br>
<a style="font-family:'times new roman';font-size:12pt;" href="https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pgpool.net%2Fmailman%2Flistinfo%2Fpgpool-general&amp;data=02%7C01%7Cgfernandez%40hotelbeds.com%7C8c4054261a2c4f14b88508d497cfb45e%7Cde51db7560c744dfa7ec886324f5e521%7C0%7C0%7C636300365735508276&amp;sdata=kt44KUzZ16TZIJVR7YmLBb%2B728ZSSU80mlPX50jGtIU%3D&amp;reserved=0" rel="nofollow" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a></td>
</tr>
</tbody></table>
<br><br>
<br>
<br>
<br>
<span style="font-family:'arial';font-size:10pt;color:#c0c0c0;"><i>-- <br>
С уважением,<br>
PVY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</i></span><a style="font-family:'arial';font-size:10pt;" href="mailto:balroga3@yandex.ru" rel="nofollow" target="_blank">mailto:balroga3@yandex.ru</a> </div></div>_______________________________________________<br>pgpool-general mailing list<br><a href="mailto:pgpool-general@pgpool.net" rel="nofollow" target="_blank">pgpool-general@pgpool.net</a><br><a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="nofollow" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br></div></div></div></body></html>