<div dir="ltr">You are right, my resource-stickiness settings are lost. after set it again, it's working now.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 31, 2016 at 3:14 PM, Klaus Wenninger <span dir="ltr"><<a href="mailto:kwenning@redhat.com" target="_blank">kwenning@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 05/31/2016 06:43 AM, wd wrote:<br>
> I've do more searching, and found "crm_simulate -sL" tool, it says:<br>
><br>
> native_color: vip-slave allocation score on node1: 100<br>
> native_color: vip-slave allocation score on node2: 50<br>
> native_color: vip-slave allocation score on node3: INFINITY<br>
</span>might be due to resource-stickiness ...<br>
<span class="">><br>
> seems 'pcs constraint colocation add vip-slave with Slave pgsql-master<br>
> 100' not effect node3 which is also a slave node.<br>
><br>
> On Tue, May 31, 2016 at 12:32 PM, wd <<a href="mailto:wd@wdicc.com">wd@wdicc.com</a><br>
</span><span class="">> <mailto:<a href="mailto:wd@wdicc.com">wd@wdicc.com</a>>> wrote:<br>
><br>
> sorry, I've sent to the wrong mailist, fwd<br>
</span>> to <a href="mailto:users@clusterlabs.org">users@clusterlabs.org</a> <<a href="http://clusterlabs.org" rel="noreferrer" target="_blank">http://clusterlabs.org</a>><br>
<span class="">><br>
> ---------- Forwarded message ----------<br>
> From: *wd* <<a href="mailto:wd@wdicc.com">wd@wdicc.com</a> <mailto:<a href="mailto:wd@wdicc.com">wd@wdicc.com</a>>><br>
> Date: Tue, May 31, 2016 at 12:04 PM<br>
> Subject: Three node cluster constraint<br>
> To: <a href="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</a><br>
</span><div><div class="h5">> <mailto:<a href="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</a>><br>
><br>
><br>
> Hi,<br>
><br>
> I've setup a three node PostgreSQL cluster, with 2 virtual ip.<br>
><br>
> vip-master (ocf::qunar:qIPaddr2): Started node2<br>
> vip-slave (ocf::qunar:qIPaddr2): Started node3<br>
> Master/Slave Set: pgsql-master [pgsql]<br>
> pgsql (ocf::qunar:qpgsql): Master node2<br>
> pgsql (ocf::qunar:qpgsql): Started node1<br>
> pgsql (ocf::qunar:qpgsql): Slave node3<br>
> Masters: [ node2 ]<br>
> Slaves: [ node1 node3 ]<br>
><br>
> I want vip-slave is running on slave node if there is any slave<br>
> node running. And if there is no slave node running, vip-slave<br>
> should run at master node. I've tried these constraint:<br>
><br>
> Location Constraints:<br>
> Ordering Constraints:<br>
> promote pgsql-master then start vip-master (score:INFINITY)<br>
> (non-symmetrical)<br>
> demote pgsql-master then stop vip-master (score:0) (non-symmetrical)<br>
> Colocation Constraints:<br>
> vip-master with pgsql-master (score:INFINITY) (rsc-role:Started)<br>
> (with-rsc-role:Master)<br>
> vip-slave with pgsql-master (score:100) (rsc-role:Started)<br>
> (with-rsc-role:Slave)<br>
> vip-slave with pgsql-master (score:50) (rsc-role:Started)<br>
> (with-rsc-role:Master)<br>
><br>
> If I kill pgsql on node3:<br>
><br>
> vip-master (ocf::qunar:qIPaddr2): Started node2<br>
> vip-slave (ocf::qunar:qIPaddr2): Started node3<br>
> Master/Slave Set: pgsql-master [pgsql]<br>
> pgsql (ocf::qunar:qpgsql): Master node2<br>
> pgsql (ocf::qunar:qpgsql): Slave node1<br>
> pgsql (ocf::qunar:qpgsql): Stopped<br>
> Masters: [ node2 ]<br>
> Slaves: [ node1 ]<br>
> Stopped: [ node3 ]<br>
><br>
> vip-slave will not goto node1, where am I wrong ?<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
> <a href="http://clusterlabs.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://clusterlabs.org/mailman/listinfo/users</a><br>
><br>
> Project Home: <a href="http://www.clusterlabs.org" rel="noreferrer" target="_blank">http://www.clusterlabs.org</a><br>
> Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel="noreferrer" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
> Bugs: <a href="http://bugs.clusterlabs.org" rel="noreferrer" target="_blank">http://bugs.clusterlabs.org</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
<a href="http://clusterlabs.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://clusterlabs.org/mailman/listinfo/users</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" rel="noreferrer" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel="noreferrer" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" rel="noreferrer" target="_blank">http://bugs.clusterlabs.org</a><br>
</blockquote></div><br></div>