[pgpool-general: 2786] Re: Fwd: Query primary node using pcp

Sam Lancia sam at gpsm.co.uk
Tue Apr 22 21:24:52 JST 2014


Thanks Yugo, that works perfectly.


On 18 April 2014 09:13, Yugo Nagata <nagata at sraoss.co.jp> wrote:

> Hi,
>
> On Thu, 17 Apr 2014 16:52:55 +0100
> Sam Lancia <sam at gpsm.co.uk> wrote:
>
> > Hi there,
> > Is there a way to programatically query the primary node of a
> master/slaves
> > architecture over pcp? Currently I am grepping the log for "primary node
>
> No. pcp command can't say which node is parimary/master. Instead you can
> use
> "SHOW pool_nodes" SQL command.
>
> $ psql -p 11002 test -c "show pool_nodes"
>  node_id | hostname | port  | status | lb_weight |  role
> ---------+----------+-------+--------+-----------+--------
>  0       | /tmp     | 11000 | 2      | 0.500000  | master
>  1       | /tmp     | 11001 | 2      | 0.500000  | slave
> (2 rows)
>
>
>
> > is", which seems a bit of a fudge!
> > Many thanks,fudge
> > Sam
>
>
> --
> Yugo Nagata <nagata at sraoss.co.jp>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20140422/b0ef9cf7/attachment.html>


More information about the pgpool-general mailing list