[Pacemaker] how to prevent auto relocation of recources to old primary?

Dominik Klein dk at in-telegence.net
Wed Mar 18 05:45:05 EDT 2009


Juha Heinanen wrote:
> Dominik Klein writes:
> 
>  > Sounds like you missed the order and colocation constraints. Please post
>  > your configuration.
> 
> i have "order" and "colocation", but removed "location", because i
> thought that by doing so, the resources will stay where they are
> working.
> 
> -- juha
> 
> $ crm configure show
> 
> node $id="8df8447f-6ecf-41a7-a131-c89fd59a120d" lenny1
> node $id="f13aff7b-6c94-43ac-9a24-b118e62d5325" lenny2
> primitive drbd0 ocf:heartbeat:drbd \
> 	params drbd_resource="drbd0" \
> 	op monitor interval="59s" role="Master" timeout="30s" \
> 	op monitor interval="60s" role="Slave" timeout="30s"
> primitive fs0 ocf:heartbeat:Filesystem \
> 	params ftype="ext3" directory="/var/lib/mysql" device="/dev/drbd0" \
> 	meta target-role="Started"
> primitive mysql-server lsb:mysql \
> 	op monitor interval="10s" timeout="30s" start-delay="10s"
> primitive virtual-ip ocf:heartbeat:IPaddr2 \
> 	params ip="192.98.102.10" broadcast="192.98.102.255" nic="eth1" cidr_netmask="24" \
> 	op monitor interval="21s" timeout="5s"
> group mysql-group fs0 mysql-server virtual-ip
> ms ms-drbd0 drbd0 \
> 	meta clone-max="2" notify="true" globally-unique="false" target-role="Started"
> colocation mysql-group-on-ms-drbd0 inf: mysql-group ms-drbd0:Master
> order ms-drbd0-before-mysql-group inf: ms-drbd0:promote mysql-group:start
> property $id="cib-bootstrap-options" \
> 	dc-version="1.0.2-ec6b0bbee1f3aa72c4c2559997e675db6ab39160"

That configuration looks good. Maybe i misunderstood what you were saying.

Let me quote you:

> when i shutdown the current primary, the resources get moved ok to
secondary,
> but when the old primary comes back up, the resources are automatically
> relocated back to the it.  why is that and how to prevent it?

I understood your mysql moved to a drbd in secondary mode (which would
have been wrong but possible without order/colocation). But maybe what
you meant was that your mysql moved to the other node, which was
hopefully promoted correctly and then moved back to the first node once
it came back to the cluster.

You can avoid this behaviour by setting the crm_config parameter
default-resource-stickiness to some positive integer value.

Is this what you meant and does it work with the configuration?

Regards
Dominik




More information about the Pacemaker mailing list