[pgpool-general: 4170] Re: pcp commands

Shay Cohavi cohavisi at gmail.com
Thu Nov 5 21:12:58 JST 2015


Hi,
when performing attach/detach node via pcp commnad , the actions are
performed flawlessly!!!

# psql -U postgres -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  | primary
 1       | 192.168.15.56 | 5432 | 2      | 0.500000  | standby
(2 rows)

[root at mgrdb-55 ~]# pcp_detach_node 10 192.168.15.59 9898 fabrix fabrix 0
[root at mgrdb-55 ~]# psql -U postgres -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)


[root at mgrdb-55 ~]# pcp_attach_node 10 192.168.15.59 9898 fabrix fabrix 0

using these command works as expected with not pgpool connection problems!
using pgpool_adm has a connection problems ... as describe before!!


Please advice....


On Wed, Nov 4, 2015 at 9:45 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:

> Can you elaborate what "everything works great" actually means?
> Sharing the exact command lines done by pcp commands are ideal...
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
> > I have simulated the exact scenario with pcp commands (not pgpool_adm sql
> > commands) and everything works great!!
> > but I need to use the pgpool_adm command (via sql)......
> > any ideas how can I track the disconnection errors?
> >
> > Thanks,
> > cohavisi
> >
> > On Wed, Nov 4, 2015 at 1:44 AM, Tatsuo Ishii <ishii at postgresql.org>
> wrote:
> >
> >> It's an expected behavior. pgpool-II disconnects sessions to client
> >> when failover occurs.
> >>
> >> Best regards,
> >> --
> >> Tatsuo Ishii
> >> SRA OSS, Inc. Japan
> >> English: http://www.sraoss.co.jp/index_en.php
> >> Japanese:http://www.sraoss.co.jp
> >>
> >> > Hi,
> >> > I have another issue regarding detach/attach node via pgpool_adm
> >> functions:
> >> > looks like everytime I detach the primary node (in order to trigger a
> >> > failover), the connection to the pgpool get lost:
> >> >
> >> >
> >> > [root at localhost ~]# psql -U postgres template1 -h 192.168.15.59 -p
> 9999
> >> > Password for user postgres:
> >> > psql (9.3.1)
> >> > Type "help" for help.
> >> >
> >> > template1=# show pool_nodes;
> >> >  node_id |   hostname    | port | status | lb_weight |  role
> >> > ---------+---------------+------+--------+-----------+---------
> >> >  0       | 192.168.15.55 | 5432 | 2      | 0.500000  | primary
> >> >  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | standby
> >> > (2 rows)
> >> >
> >> >
> >> > template1=#
> >> > template1=#
> >> > template1=#
> >> > template1=# select
> >> > pcp_detach_node(0,False,'192.168.15.59',500,9898,'usr','pass');
> >> >  pcp_detach_node
> >> > -----------------
> >> >  t
> >> > (1 row)
> >> >
> >> > template1=# show pool_nodes;
> >> > *The connection to the server was lost. Attempting reset:*
> >> > *Succeeded.*
> >> > template1=# show pool_nodes;
> >> >  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,'usr','pass');
> >> > *The connection to the server was lost. Attempting reset: Succeeded.*
> >> > template1=# select
> >> pcp_attach_node(0,'192.168.15.59',500,9898,'usr','pass');
> >> >  pcp_attach_node
> >> > -----------------
> >> >  t
> >> > (1 row)
> >> >
> >> >
> >> >
> >> > template1=# show pool_nodes;
> >> >  node_id |   hostname    | port | status | lb_weight |  role
> >> > ---------+---------------+------+--------+-----------+---------
> >> >  0       | 192.168.15.55 | 5432 | 1      | 0.500000  | standby
> >> >  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
> >> > (2 rows)
> >> >
> >> > template1=# show pool_nodes;
> >> >  node_id |   hostname    | port | status | lb_weight |  role
> >> > ---------+---------------+------+--------+-----------+---------
> >> >  0       | 192.168.15.55 | 5432 | 1      | 0.500000  | standby
> >> >  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
> >> > (2 rows)
> >> >
> >> > template1=# show pool_nodes;
> >> >  node_id |   hostname    | port | status | lb_weight |  role
> >> > ---------+---------------+------+--------+-----------+---------
> >> >  0       | 192.168.15.55 | 5432 | 1      | 0.500000  | standby
> >> >  1       | 192.168.15.56 | 5432 | 2      | 0.500000  | primary
> >> >
> >> >
> >> > template1=# show pool_nodes;
> >> >  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=#
> >> >
> >> >
> >> > Please advise.....
> >> >
> >> > cohavisi
> >> >
> >> >
> >> > On Thu, Oct 29, 2015 at 1:50 PM, Shay Cohavi <cohavisi at gmail.com>
> wrote:
> >> >
> >> >> Thanks!!!!
> >> >> I'm using postgres 9.3.1 !
> >> >>
> >> >>
> >> >> On Thu, Oct 29, 2015 at 8:58 AM, Tatsuo Ishii <ishii at postgresql.org>
> >> >> wrote:
> >> >>
> >> >>> >> *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.
> >> >>> >> !>
> >> >>> >
> >> >>> > Will look into this.
> >> >>>
> >> >>> Assuming you are using PostgreSQL 9.4, I found some compiler
> warnings
> >> >>> with the source file. Please try attached patches.
> >> >>>
> >> >>> 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/20151105/85ee67a3/attachment.html>


More information about the pgpool-general mailing list