[ClusterLabs] Three node cluster constraint

wd wd at wdicc.com
Tue May 31 04:43:07 UTC 2016


I've do more searching, and found "crm_simulate -sL" tool, it says:

native_color: vip-slave allocation score on node1: 100
native_color: vip-slave allocation score on node2: 50
native_color: vip-slave allocation score on node3: INFINITY

seems 'pcs constraint colocation add vip-slave with Slave pgsql-master 100'
not effect node3 which is also a slave node.

On Tue, May 31, 2016 at 12:32 PM, wd <wd at wdicc.com> wrote:

> sorry, I've sent to the wrong mailist, fwd to users at clusterlabs.org
>
> ---------- Forwarded message ----------
> From: wd <wd at wdicc.com>
> Date: Tue, May 31, 2016 at 12:04 PM
> Subject: Three node cluster constraint
> To: pacemaker at oss.clusterlabs.org
>
>
> 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 ?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clusterlabs.org/pipermail/users/attachments/20160531/ab47cbd4/attachment-0002.html>


More information about the Users mailing list