It seems to me like this would be a fairly common scenario, but the fact that there are no replies makes me think I&#39;m trying to set this whole thing up incorrectly.  Am I not doing this the &quot;normal&quot; way? or is it just not as common as I would expect?....or is this whole thing just a stupid newbie question? :)<div>
<br><div><br><div class="gmail_quote">On Fri, Aug 26, 2011 at 5:07 PM, Chris Redekop <span dir="ltr">&lt;<a href="mailto:chris@replicon.com">chris@replicon.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">I&#39;m attempting to set up a master/slave database cluster where the master is R/W and the slave is R/O.  The master failure scenario works fine (slave becomes master, master vip moves over)....however when the slave resource goes down I want the slave vip to move to the master and then move back when the slave comes back up...I can&#39;t seem to get this to work properly.  Here&#39;s my test config I&#39;m playing with:<div>


<br></div><div><div>primitive postgresql ocf:custom:pgsql \</div><div>        op monitor interval=&quot;30&quot; timeout=&quot;30&quot; depth=&quot;0&quot;</div><div>primitive primaryip ocf:heartbeat:IPaddr2 \</div><div>

        params ip=&quot;10.0.100.102&quot;</div>
<div>primitive slaveip ocf:heartbeat:IPaddr2 \</div><div>        params ip=&quot;10.0.100.103&quot;</div><div>ms ms_postgresql postgresql \</div><div>        meta clone-max=&quot;2&quot; clone-node-max=&quot;1&quot; master-max=&quot;1&quot; master-node-max=&quot;1&quot; notify=&quot;true&quot; target-role=&quot;Started&quot;</div>


<div>colocation postgres_on_primaryip inf: primaryip ms_postgresql:Master</div><div>colocation slaveip_on_master 101: slaveip ms_postgresql:Master</div><div>colocation slaveip_on_slave 1000: slaveip ms_postgresql:Slave</div>


<div>property $id=&quot;cib-bootstrap-options&quot; \</div><div>        dc-version=&quot;1.0.11-1554a83db0d3c3e546cfd3aaff6af1184f79ee87&quot; \</div><div>        cluster-infrastructure=&quot;openais&quot; \</div><div>        expected-quorum-votes=&quot;2&quot; \</div>


<div>        stonith-enabled=&quot;false&quot; \</div><div>        no-quorum-policy=&quot;ignore&quot; \</div><div>        last-lrm-refresh=&quot;1314201732&quot;</div><div>rsc_defaults $id=&quot;rsc-options&quot; \</div>


<div>        resource-stickiness=&quot;100&quot;</div></div><div><br></div></div><div>With the configuration like this it looks pretty straight forward but it actually results in the slaveip not being run on *either* node.  As far as I can figure out it seems when you have a colocation to a specific role it implicitly generates a -inf record for the other role.  So the :Master generates a -inf for :Slave, and :Slave generates a -inf for :Master, and since slaveip has a colocation record for both they get added together resulting in a -inf score for both nodes...if I wasn&#39;t so new at this I would think that is a bug.  If I key the ip off the node&#39;s up/down status (like via &#39;colocation whatever -101: slaveip primaryip&#39;) then it works if I standby the slave node but of course it doesn&#39;t work if the resource fails while the node stays up.  Can anyone shed some light on how to make this work properly?  Thanks!</div>


</div><br>
</blockquote></div><br></div></div>