[Pacemaker] Clone set members colocation
Andreas Kurz
andreas at hastexo.com
Tue Nov 8 23:28:31 CET 2011
Hello,
On 11/08/2011 10:42 PM, Yves Trudeau wrote:
> Hi,
> I am currently working on a replication solution adding logic to the
> mysql RA and I need to be able to turn ON/OFF a virtual IP based on a
> node attribute (Florian suggestion). In order to achieve this, I
> created a clone set of IPaddr2 RA and a location rule using the node
> attribute setting. It works almost correctly except that clone members
> stick a bit too much and don't failback. Here's my config:
>
> node testvirtbox1 \
> attributes IP="10.2.2.160"
> node testvirtbox2 \
> attributes IP="10.2.2.161" \
> attributes standby="off"
> node testvirtbox3 \
> attributes IP="10.2.2.162" \
> attributes standby="off"
> primitive reader_vip_1 ocf:heartbeat:IPaddr2 \
> params ip="10.2.2.171" nic="eth0"
> clone reader_vips reader_vip_1 \
> meta globally-unique="true" clone-max="3" clone-node-max="3"
> notify="true" ordered="true" interleave="true"
> location No-reader-vip-loc reader_vips \
> rule $id="No-reader-vip-rule" -inf: readerOK eq 0
> colocation reader_vips_dislike_reader_vips -200: reader_vips reader_vips
> property $id="cib-bootstrap-options" \
> dc-version="1.0.11-a15ead49e20f047e129882619ed075a65c1ebdfe" \
> cluster-infrastructure="openais" \
> expected-quorum-votes="3" \
> stonith-enabled="false" \
> no-quorum-policy="ignore"
> rsc_defaults $id="rsc-options" \
> resource-stickiness="100"
>
>
>
> - Upon startup, the reader_vips clone are well spread on all 3 nodes
> - Running "crm_attribute -N testvirtbox1 -l reboot --name readerOK -s
> mysql_replication -v '0'" removes the clone set member from
> testvirtbox1 as expected and add it to testvirtbox2 or testvirtbox3
> - But... running "crm_attribute -N testvirtbox1 -l reboot --name
> readerOK -s mysql_replication -v '1'" does not make it come back, one of
> the other node still have 2 clone members
>
> Is there a way to make it come back normally or is there something I
> don't do correctly?
You can expand your location constraint with a rule to add a score of
200 if "readerOK eq 1" to override stickiness ... and you might also
want to check if the attribute is already defined.
Regards,
Andreas
--
Need help with Pacemaker?
http://www.hastexo.com/now
>
> Regards,
>
> Yves
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs:
> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 286 bytes
Desc: OpenPGP digital signature
URL: <http://oss.clusterlabs.org/pipermail/pacemaker/attachments/20111108/7fcd2bef/attachment.sig>
More information about the Pacemaker
mailing list