[pgpool-general: 3053] Correct procedure for restarting a pgpool node

James Sewell james.sewell at lisasoft.com
Fri Jul 25 09:36:00 JST 2014


Hello all,

I have two pgpool nodes which I am using a TCP load balancer to spread
between. I am using watchdog to synchronise PostgreSQL node information
between the two and an external HA solution (with ALLOW_TO_FAILOVER).

If I start both my pgpool nodes up I get the following inital state:

postgres=# show pool_nodes;
 node_id |  hostname   | port | status | lb_weight |  role
---------+-------------+------+--------+-----------+---------
 0       | 10.10.10.1   | 5432 | 2      | 0.500000  | standby
 1       | 10.10.10.2   | 5432 | 2      | 0.500000  | primary
(2 rows)

And then I run the following command:

 pcp_detach_node 1 load_balancer 9898 postgres postgres 0

Now both pgpool nodes show the following:

postgres=# show pool_nodes;
 node_id |  hostname   | port | status | lb_weight |  role
---------+-------------+------+--------+-----------+---------
 0       | 10.10.10.1  | 5432 | 3      | 0.500000  | standby
 1       | 10.10.10.2  | 5432 | 2      | 0.500000  | primary
(2 rows)

This proves watchdog is working, as the command is sent to one pgpool node
through the load_balancer.

Now if I restart pgpool node two I would expect it to come back up with the
config above, not the initial config - as it would have talked to the
watchdog on the other node. This is not the case though.

The non restarted node still reports:

postgres=# show pool_nodes;
 node_id |  hostname   | port | status | lb_weight |  role
---------+-------------+------+--------+-----------+---------
 0       | 10.10.10.1  | 5432 | 3      | 0.500000  | standby
 1       | 10.10.10.2  | 5432 | 2      | 0.500000  | primary
(2 rows)

And the restarted node reports:

postgres=# show pool_nodes;
 node_id |  hostname   | port | status | lb_weight |  role
---------+-------------+------+--------+-----------+---------
 0       | 10.10.10.1   | 5432 | 2      | 0.500000  | standby
 1       | 10.10.10.2   | 5432 | 2      | 0.500000  | primary
(2 rows)

Any ideas on how to fix this?

James Sewell,
PostgreSQL Team Lead / Solutions Architect
______________________________________


 Level 2, 50 Queen St, Melbourne VIC 3000

*P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099

-- 


------------------------------
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this 
email is free of viruses or other defects. If you have received this 
communication in error, you may not copy or distribute any part of it or 
otherwise disclose its contents to anyone. Please advise the sender of your 
incorrect receipt of this correspondence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20140725/87035f89/attachment.html>


More information about the pgpool-general mailing list