sorry, I've sent to the wrong mailist, fwd to [email protected]
---------- Forwarded message ----------
From: wd <[email protected]>
Date: Tue, May 31, 2016 at 12:04 PM
Subject: Three node cluster constraint
To: [email protected]
Hi,
I've setup a three node PostgreSQL cluster, with 2 virtual ip.
vip-master (ocf::qunar:qIPaddr2): Started node2
vip-slave (ocf::qunar:qIPaddr2): Started node3
Master/Slave Set: pgsql-master [pgsql]
pgsql (ocf::qunar:qpgsql): Master node2
pgsql (ocf::qunar:qpgsql): Started node1
pgsql (ocf::qunar:qpgsql): Slave node3
Masters: [ node2 ]
Slaves: [ node1 node3 ]
I want vip-slave is running on slave node if there is any slave node
running. And if there is no slave node running, vip-slave should run at
master node. I've tried these constraint:
Location Constraints:
Ordering Constraints:
promote pgsql-master then start vip-master (score:INFINITY)
(non-symmetrical)
demote pgsql-master then stop vip-master (score:0) (non-symmetrical)
Colocation Constraints:
vip-master with pgsql-master (score:INFINITY) (rsc-role:Started)
(with-rsc-role:Master)
vip-slave with pgsql-master (score:100) (rsc-role:Started)
(with-rsc-role:Slave)
vip-slave with pgsql-master (score:50) (rsc-role:Started)
(with-rsc-role:Master)
If I kill pgsql on node3:
vip-master (ocf::qunar:qIPaddr2): Started node2
vip-slave (ocf::qunar:qIPaddr2): Started node3
Master/Slave Set: pgsql-master [pgsql]
pgsql (ocf::qunar:qpgsql): Master node2
pgsql (ocf::qunar:qpgsql): Slave node1
pgsql (ocf::qunar:qpgsql): Stopped
Masters: [ node2 ]
Slaves: [ node1 ]
Stopped: [ node3 ]
vip-slave will not goto node1, where am I wrong ?
_______________________________________________
Users mailing list: [email protected]
http://clusterlabs.org/mailman/listinfo/users
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org