<div dir="ltr"><div>I found the solution, add colocation constraint like this:</div><div><br></div><div>pcs constraint colocation add vip-slave with Slave pgsql-master 100</div><div>pcs constraint colocation add vip-slave with Master pgsql-master 50</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 6:08 PM, wd <span dir="ltr"><<a href="mailto:wd@wdicc.com" target="_blank">wd@wdicc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'm running a master/slave 2 node PostgreSQL cluster, and 2 virtual ip resource, one is for master, one is for slave.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">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.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>pcs constraint colocation add vip-master with Master pgsql-master</div><div>pcs constraint colocation add vip-slave with Slave pgsql-master</div><div><br></div><div>pcs constraint order promote pgsql-master then start vip-master symmetrical=false score=INFINITY</div><div>pcs constraint order demote pgsql-master then stop vip-master symmetrical=false score=0</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">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?</div></div>
</blockquote></div><br></div>