[pgpool-general: 4152] Re: pcp commands

Shay Cohavi cohavisi at gmail.com
Wed Oct 28 01:42:50 JST 2015


Hi,

pcp_node_count & pcp_attach_node  & pcp_detach_node is working...but
pcp_pool_ststus & pcp_node_info gets errors...


*pcp_node_count*
template1=# select pcp_node_count('192.168.15.59',500,9898,'user','pass');
 pcp_node_count
----------------
              2
(1 row)


*pcp_pool_status*

template1=# select pcp_pool_status('192.168.15.59',500,9898,'user','pass');
ERROR:  set-valued function called in context that cannot accept a set


*pcp_node_info*

template1=# select pcp_node_info(0,'192.168.15.59',500,9898,'user','pass');
The connection to the server was lost. Attempting reset: Failed.
!>


*pcp_attach_node*

[root at localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c
'show pool_nodes;'
Password for user postgres:
 node_id |   hostname    | port | status | lb_weight |  role
---------+---------------+------+--------+-----------+---------
 0       | 192.168.15.55 | 5432 | 3      | 0.500000  | standby
 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
(2 rows)


template1=# select
pcp_attach_node(0,'192.168.15.59',500,9898,'user','pass');
 pcp_attach_node
-----------------
 t
(1 row)


[root at localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c
'show pool_nodes;'
Password for user postgres:
 node_id |   hostname    | port | status | lb_weight |  role
---------+---------------+------+--------+-----------+---------
 0       | 192.168.15.55 | 5432 | 2      | 0.500000  | standby
 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
(2 rows)


*pcp_detach_node*

[root at localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c
'show pool_nodes;'
Password for user postgres:
 node_id |   hostname    | port | status | lb_weight |  role
---------+---------------+------+--------+-----------+---------
 0       | 192.168.15.55 | 5432 | 2      | 0.500000  | standby
 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
(2 rows)


template1=# select
pcp_detach_node(0,False,'192.168.15.59',500,9898,'user','pass');
 pcp_detach_node
-----------------
 t
(1 row)

[root at localhost]# psql -U postgres template1 -h 192.168.15.59 -p 9999 -c
'show pool_nodes;'
Password for user postgres:
 node_id |   hostname    | port | status | lb_weight |  role
---------+---------------+------+--------+-----------+---------
 0       | 192.168.15.55 | 5432 | 3      | 0.500000  | standby
 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
(2 rows)


Thanks,
cohavisi


On Tue, Oct 27, 2015 at 4:36 PM, Shay Cohavi <cohavisi at gmail.com> wrote:

> hi,
> I had managed to compile and install the pgpool_adm extension!!
> but,i've got errors (connection errors):
>
> select pcp_node_info(1,'*pgpool_vip*',10,*pcp_port* ,'*pcp_usr*','
> *pcp_pass*');
>
> template1=# select
> pcp_node_info(1,'192.168.15.59',10,9898,'myusr','mypass');
> FATAL:  unable to read data from DB node 1
> DETAIL:  EOF encountered with backend
> FATAL:  unable to read data from DB node 1
> DETAIL:  EOF encountered with backend
> The connection to the server was lost. Attempting reset: Failed.
>
> any ideas???
>
> Thanks...
>
>
>
>
> On Sun, Oct 25, 2015 at 8:16 PM, Shay Cohavi <cohavisi at gmail.com> wrote:
>
>> Thanks a lot!!!
>> l'll check it
>>
>> On Sun, Oct 25, 2015 at 10:02 AM, Tatsuo Ishii <ishii at postgresql.org>
>> wrote:
>>
>>> > Hi,
>>> > Is there any why to execute pcp command:
>>> > pcp_detach_node...
>>> > pcp_attach_node...
>>> >
>>> > via SQL functions? or via http service (not pgpool Admin GUI)??
>>>
>>> There's a set of SQL functions called "pgpool_adm" in the source tree.
>>> See src/sql/pgpool_adm.
>>>
>>> One you install the pgpool_adm extesion, you can do;
>>>
>>> select pcp_attach_node(1, 'localhost', 0, 11001, 'username', 'password');
>>>
>>> arg1: node id to be attached (int)
>>> arg2: host name on which pcp server runs on (text) usually 'localhost'.
>>> arg3: time out value (int). Currently ignored and whatever value can be
>>> accepted.
>>> arg4: port number which pcp server listens (int)
>>> arg5: pcp user name (text)
>>> arg6: pcp password (text)
>>>
>>> Best regards,
>>> --
>>> Tatsuo Ishii
>>> SRA OSS, Inc. Japan
>>> English: http://www.sraoss.co.jp/index_en.php
>>> Japanese:http://www.sraoss.co.jp
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20151027/03e2f13a/attachment.html>


More information about the pgpool-general mailing list