[pgpool-general: 2913] Re: how to easily find the master backend

Yugo Nagata nagata at sraoss.co.jp
Wed Jun 11 21:27:20 JST 2014


Hi,

You can use "SHOW pool_nodes" query, which will say each backend's roles.

test=# show pool_nodes;
 node_id | hostname | port  | status | lb_weight |  role   
---------+----------+-------+--------+-----------+---------
 0       | /tmp     | 11000 | 2      | 0.500000  | primary
 1       | /tmp     | 11001 | 2      | 0.500000  | standby
(2 rows)


On Mon, 09 Jun 2014 12:20:40 -0700
Alexandru Cardaniuc <cardaniuc at gmail.com> wrote:

> 
> Hi,
> 
> I have a cluster of 2 PostgreSQL 9.3 databases using streaming
> replication managed by a cluster of 2 Pgpool 3.3.3 (using watchdog). To
> identy the primary pgpool I can run pcp_watchdog_info command, which
> will give me the IP of the server that primary pgpool is running on right now.
> 
> What's the best way to easily find the master backend database in that
> setup? I need for instance to go and make some changes on the master
> backend and want to know which of the 2 databases in the cluster is the
> master at this point.
> 
> thanks,
> Alexandru
> 
> -- 
> "In language, clarity is everything."  
> - Confucius
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general


-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-general mailing list