[ClusterLabs] How to add a constraint to move a resource to other node when a resource stop
wd
wd at wdicc.com
Fri May 13 12:16:28 UTC 2016
I found the solution, add colocation constraint like this:
pcs constraint colocation add vip-slave with Slave pgsql-master 100
pcs constraint colocation add vip-slave with Master pgsql-master 50
On Fri, May 13, 2016 at 6:08 PM, wd <wd at wdicc.com> wrote:
> hi,
>
> I'm running a master/slave 2 node PostgreSQL cluster, and 2 virtual ip
> resource, one is for master, one is for slave.
>
> I have add colocation constraint for both virtual ip and master/slave
> resource, to ensure virtual ip for master is run at master, and virtual ip
> for slave is run at slave. And also add constraint for PostgreSQL promote.
>
> pcs constraint colocation add vip-master with Master pgsql-master
> pcs constraint colocation add vip-slave with Slave pgsql-master
>
> pcs constraint order promote pgsql-master then start vip-master
> symmetrical=false score=INFINITY
> pcs constraint order demote pgsql-master then stop vip-master
> symmetrical=false score=0
>
> If I kill PostgreSQL master process, pacemaker will promote slave to new
> master, and move master-vip to the new master. But the slave-vip will stop.
> So how to let the slave-vip also move to the new master at this situation?
> And if I kill slave PostgreSQL, how to let the slave-vip move to the master?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20160513/3e738e8e/attachment.htm>
More information about the Users
mailing list