<div dir="ltr"><div>Hi,</div><div><br></div><div>pcp_node_count &amp; pcp_attach_node  &amp; pcp_detach_node is working...but pcp_pool_ststus &amp; pcp_node_info gets errors...</div><div><br></div><div><br></div><div><b>pcp_node_count</b><br></div><div>template1=# select pcp_node_count(&#39;192.168.15.59&#39;,500,9898,&#39;user&#39;,&#39;pass&#39;);</div><div> pcp_node_count</div><div>----------------</div><div>              2</div><div>(1 row)</div><div><br></div><div><br></div><div><b>pcp_pool_status</b><br></div><div><br></div><div><font color="#ff0000">template1=# select pcp_pool_status(&#39;192.168.15.59&#39;,500,9898,&#39;user&#39;,&#39;pass&#39;);</font></div><div><font color="#ff0000">ERROR:  set-valued function called in context that cannot accept a set</font></div><div><br></div><div><div><div><br></div><div><b>pcp_node_info</b><br></div><div><b><br></b></div><div><font color="#ff0000">template1=# select pcp_node_info(0,&#39;192.168.15.59&#39;,500,9898,&#39;</font><span style="color:rgb(255,0,0)">user</span><font color="#ff0000">&#39;,&#39;</font><span style="color:rgb(255,0,0)">pass</span><font color="#ff0000">&#39;);</font></div><div><font color="#ff0000">The connection to the server was lost. Attempting reset: Failed.</font></div><div><font color="#ff0000">!&gt;</font></div></div><div><br></div><div><br></div><div><b>pcp_attach_node</b><br></div><div><div><br></div><div><div>[root@localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c &#39;show pool_nodes;&#39;</div><div>Password for user postgres:</div><div> node_id |   hostname    | port | status | lb_weight |  role</div><div>---------+---------------+------+--------+-----------+---------</div><div> 0       | 192.168.15.55 | 5432 | 3      | 0.500000  | standby</div><div> 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary</div><div>(2 rows)</div></div><div><br></div><div><br></div><div>template1=# select pcp_attach_node(0,&#39;192.168.15.59&#39;,500,9898,&#39;user&#39;,&#39;pass&#39;);</div><div> pcp_attach_node</div><div>-----------------</div><div> t</div><div>(1 row)</div></div><div><br></div><div><br></div><div>[root@localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c &#39;show pool_nodes;&#39;</div><div>Password for user postgres:</div><div> node_id |   hostname    | port | status | lb_weight |  role</div><div>---------+---------------+------+--------+-----------+---------</div><div> 0       | 192.168.15.55 | 5432 | 2      | 0.500000  | standby</div><div> 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary</div><div>(2 rows)</div></div><div><br></div><div><br></div><div><b>pcp_detach_node</b><br></div><div><br></div><div><div>[root@localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c &#39;show pool_nodes;&#39;</div><div>Password for user postgres:</div><div> node_id |   hostname    | port | status | lb_weight |  role</div><div>---------+---------------+------+--------+-----------+---------</div><div> 0       | 192.168.15.55 | 5432 | 2      | 0.500000  | standby</div><div> 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary</div><div>(2 rows)</div></div><div><br></div><div><br></div><div><div>template1=# select pcp_detach_node(0,False,&#39;192.168.15.59&#39;,500,9898,&#39;user&#39;,&#39;pass&#39;);</div><div> pcp_detach_node</div><div>-----------------</div><div> t</div><div>(1 row)</div><div><br></div></div><div><div>[root@localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c &#39;show pool_nodes;&#39;</div><div>Password for user postgres:</div><div> node_id |   hostname    | port | status | lb_weight |  role</div><div>---------+---------------+------+--------+-----------+---------</div><div> 0       | 192.168.15.55 | 5432 | 3      | 0.500000  | standby</div><div> 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary</div><div>(2 rows)</div></div><div><br></div><div><br></div><div>Thanks,</div><div>cohavisi</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 27, 2015 at 4:36 PM, Shay Cohavi <span dir="ltr">&lt;<a href="mailto:cohavisi@gmail.com" target="_blank">cohavisi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>hi,</div><div>I had managed to compile and install the pgpool_adm extension!!</div><div>but,i&#39;ve got errors (connection errors):</div><div><br></div><div>select pcp_node_info(1,&#39;<b>pgpool_vip</b>&#39;,10,<b>pcp_port</b> ,&#39;<b>pcp_usr</b>&#39;,&#39;<b>pcp_pass</b>&#39;);<br></div><div><br></div><div>template1=# select pcp_node_info(1,&#39;192.168.15.59&#39;,10,9898,&#39;myusr&#39;,&#39;mypass&#39;);</div><div>FATAL:  unable to read data from DB node 1</div><div>DETAIL:  EOF encountered with backend</div><div>FATAL:  unable to read data from DB node 1</div><div>DETAIL:  EOF encountered with backend</div><div>The connection to the server was lost. Attempting reset: Failed.</div><div><br></div><div>any ideas???</div><div><br></div><div>Thanks...</div><div><br></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 25, 2015 at 8:16 PM, Shay Cohavi <span dir="ltr">&lt;<a href="mailto:cohavisi@gmail.com" target="_blank">cohavisi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks a lot!!! <div>l&#39;ll check it</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 25, 2015 at 10:02 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>&gt; Hi,<br>
&gt; Is there any why to execute pcp command:<br>
&gt; pcp_detach_node...<br>
&gt; pcp_attach_node...<br>
&gt;<br>
&gt; via SQL functions? or via http service (not pgpool Admin GUI)??<br>
<br>
</span>There&#39;s a set of SQL functions called &quot;pgpool_adm&quot; in the source tree.<br>
See src/sql/pgpool_adm.<br>
<br>
One you install the pgpool_adm extesion, you can do;<br>
<br>
select pcp_attach_node(1, &#39;localhost&#39;, 0, 11001, &#39;username&#39;, &#39;password&#39;);<br>
<br>
arg1: node id to be attached (int)<br>
arg2: host name on which pcp server runs on (text) usually &#39;localhost&#39;.<br>
arg3: time out value (int). Currently ignored and whatever value can be accepted.<br>
arg4: port number which pcp server listens (int)<br>
arg5: pcp user name (text)<br>
arg6: pcp password (text)<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_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>