<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<title>Re: [pgpool-general: 5465] Re: FW: show pool_nodes status 0</title>
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI Symbol";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thank you so much for all the colleagues who has replay my question.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">It has been quite helpfully to improve my understanding of the product.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> PVY [mailto:balroga3@yandex.ru]
<br>
<b>Sent:</b> lunes, 15 de mayo de 2017 14:08<br>
<b>To:</b> Gabriel Fernández Martínez &lt;gfernandez@hotelbeds.com&gt;<br>
<b>Subject:</b> Re: [pgpool-general: 5465] Re: FW: show pool_nodes status 0<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Hello Gabriel.<br>
<br>
You can also start pgpool with &quot;-D&quot; command-line option, it tells pgpool to discard the status file on startup.</span><a name="m_-2574600489477456020Picture_x0020_2"></a><o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td width="2" style="width:1.5pt;background:blue;padding:.75pt .75pt .75pt .75pt">
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Hi Lucas,<br>
<br>
Thank you show much for your response, it works </span><span style="font-size:11.0pt;font-family:&quot;Segoe UI Symbol&quot;,sans-serif;color:#1F497D">☺</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D"><br>
<br>
</span><span style="font-size:11.0pt;color:#1F497D">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><b><span style="font-size:11.0pt;color:black">From:</span></b><span style="font-size:11.0pt;color:black"> Lucas Luengas [<a href="mailto:lucasluengas@gmail.com">mailto:lucasluengas@gmail.com</a>]
<br>
<b>Sent:</b> miércoles, 10 de mayo de 2017 20:09<br>
<b>To:</b> Gabriel Fernández Martínez &lt;<a href="mailto:gfernandez@hotelbeds.com">gfernandez@hotelbeds.com</a>&gt;<br>
<b>Cc:</b> <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<b>Subject:</b> Re: [pgpool-general: 5445] FW: show pool_nodes status 0<br>
<br>
</span><span style="color:black">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 &quot;logdir&quot; 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><a href="mailto:gfernandez@hotelbeds.com">gfernandez@hotelbeds.com</a>&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><span style="color:black"> 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>
---------&#43;----------------------&#43;------&#43;--------&#43;-----------&#43;---------&#43;------------<br>
0 &nbsp; &nbsp; &nbsp; | *************196.*** | 5</span><span style="color:#1F497D">***</span><span style="color:black"> | 2 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| primary | 0<br>
1 &nbsp; &nbsp; &nbsp; | *************198.*** | 5</span><span style="color:#1F497D">***</span><span style="color:black"> | 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><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">listen_addresses = '*'<br>
<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_hostname0 = '**********196.***'<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_port0 = 5***<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_weight0 = 1<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_data_directory0 = '/data/******1'<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_flag0 = 'ALLOW_TO_FAILOVER'<br>
<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_hostname1 = '**********198.***'<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_port1 = 5***<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_weight1 = 1<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_data_directory1 = '/data/******2'<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">enable_pool_hba = on<br>
<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">logdir = '/var/log/pgpool-II-95'<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">pid_file_name = '/data/node1/pgpool-II-95/pgpool.pid'<br>
<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">sr_check_user = 'pgpool'<br>
-</span><span style="font-size:7.0pt;color:black"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:black">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:&quot;SELECT pg_is_in_recovery()&quot;<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><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><span style="color:black">******-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>
---------&#43;----------------------&#43;------&#43;--------&#43;-----------&#43;---------&#43;------------<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><span style="color:#CC0066">Gabriel Fernández <br>
</span><b><span style="color:#5C5C5C">Technology <br>
</span></b><span style="color:#5C5C5C">Architecture<br>
<br>
</span><span style="color:#1F497D">tel: </span><a href="tel:&#43;34%20971%2018%2091%2088">(&#43;34) 971 189 188</a><br>
<span style="color:#1F497D">Ed. Mirall Cami de Son Fangos 100, B-2<br>
E-07007, Palma de Mallorca, Spain <br>
</span><a href="mailto:gfernandez@hotelbeds.com"><b><span style="font-size:10.0pt">gfernandez@hotelbeds.com</span></b></a><br>
<br>
<a href="http://group.hotelbeds.com/"><span style="text-decoration:none"><img border="0" width="400" height="75" id="_x0000_i1025" src="cid:image001.jpg@01D2CE39.E402C450"></span></a><br>
<br>
<br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a 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><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><br>
<br>
<br>
<br>
<i><span style="font-family:&quot;Arial&quot;,sans-serif;color:silver">-- <br>
С уважением,<br>
PVY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></i><a href="mailto:balroga3@yandex.ru"><span style="font-family:&quot;Arial&quot;,sans-serif">mailto:balroga3@yandex.ru</span></a><o:p></o:p></p>
</div>
</body>
</html>