[pgpool-general: 2774] Re: Fwd: Query primary node using pcp
Yugo Nagata
nagata at sraoss.co.jp
Fri Apr 18 17:13:26 JST 2014
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>
More information about the pgpool-general
mailing list