<html><head><title>Re: [pgpool-general: 5465] Re: FW: show pool_nodes status 0</title>
</head>
<body>
<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>
<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';">&#9872;<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&#233;rcoles, 10 de mayo de 2017 20:09<br>
<b>To:</b> Gabriel Fern&#225;ndez Mart&#237;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&#225;ndez Mart&#237;nez &lt;</span></span></span></span></span><a style=" font-family:'times new roman'; font-size: 12pt;" href="mailto:gfernandez@hotelbeds.com">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 &#8211;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&#225;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;" href="tel:+34%20971%2018%2091%2088">(+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">gfernandez@hotelbeds.com</a><br>
<br>
<a href="http://group.hotelbeds.com/"><img width=400 height=75 alt="" style="padding : 1px;" src="cid:FF23BD49.01D2CD73.08951B70.6C938B32_csseditor"></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">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">http://www.pgpool.net/mailman/listinfo/pgpool-general</a></td>
</tr>
</table>
<br><br>
<br>
<br>
<br>
<span style=" font-family:'arial'; font-size: 10pt; color: #c0c0c0;"><i>-- <br>
&#1057; &#1091;&#1074;&#1072;&#1078;&#1077;&#1085;&#1080;&#1077;&#1084;,<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">mailto:balroga3@yandex.ru</a> </body></html>