<div dir="ltr"><div>Hi,</div><div><br></div><div>pcp_node_count & pcp_attach_node  & pcp_detach_node is working...but pcp_pool_ststus & 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('192.168.15.59',500,9898,'user','pass');</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('192.168.15.59',500,9898,'user','pass');</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,'192.168.15.59',500,9898,'</font><span style="color:rgb(255,0,0)">user</span><font color="#ff0000">','</font><span style="color:rgb(255,0,0)">pass</span><font color="#ff0000">');</font></div><div><font color="#ff0000">The connection to the server was lost. Attempting reset: Failed.</font></div><div><font color="#ff0000">!></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 'show pool_nodes;'</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,'192.168.15.59',500,9898,'user','pass');</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 'show pool_nodes;'</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 'show pool_nodes;'</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,'192.168.15.59',500,9898,'user','pass');</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 'show pool_nodes;'</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"><<a href="mailto:cohavisi@gmail.com" target="_blank">cohavisi@gmail.com</a>></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've got errors (connection errors):</div><div><br></div><div>select pcp_node_info(1,'<b>pgpool_vip</b>',10,<b>pcp_port</b> ,'<b>pcp_usr</b>','<b>pcp_pass</b>');<br></div><div><br></div><div>template1=# select pcp_node_info(1,'192.168.15.59',10,9898,'myusr','mypass');</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"><<a href="mailto:cohavisi@gmail.com" target="_blank">cohavisi@gmail.com</a>></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'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"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>> Hi,<br>
> Is there any why to execute pcp command:<br>
> pcp_detach_node...<br>
> pcp_attach_node...<br>
><br>
> via SQL functions? or via http service (not pgpool Admin GUI)??<br>
<br>
</span>There's a set of SQL functions called "pgpool_adm" 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, 'localhost', 0, 11001, 'username', 'password');<br>
<br>
arg1: node id to be attached (int)<br>
arg2: host name on which pcp server runs on (text) usually 'localhost'.<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>