[Pacemaker] Move resources on failure

Thomas ThomasCaspari at t-online.de
Sun May 8 18:55:59 UTC 2011


Sergey V. Arlashin <maillist.arlashin at ...> writes:

> Hallo!
> I'm a newbie and I've just set up a small cluster wich consists of two nodes
with apache and one mutual ip
> address. I use corosync and pacemaker. 
> When I kill apache process crm restarts it so that apache continues working,
but I want (in case of apache
> process failure) to make crm move the whole bunch of resources to another node
instead.
> Is it possible? 
> 
> This is my config
> 
> crm(live)configure# show
> node centos1 \
> 	attributes standby="off"
> node centos2 \
> 	attributes standby="off"
> primitive mutip1 ocf:heartbeat:IPaddr \
> 	params ip="192.168.1.200" cidr_netmask="255.255.255.255" nic="eth0" \
> 	op monitor interval="5s" timeout="20s"
> primitive website lsb:httpd \
> 	op monitor interval="15" timeout="15" start-delay="15" \
> 	meta target-role="Started"
> colocation ipapache inf: mutip1 website
> order apache-after-ip inf: mutip1 website
> property $id="cib-bootstrap-options" \
> 	dc-version="1.0.11-1554a83db0d3c3e546cfd3aaff6af1184f79ee87" \
> 	cluster-infrastructure="openais" \
> 	expected-quorum-votes="2" \
> 	no-quorum-policy="ignore" \
> 	stonith-enabled="false"
> 
> ---
> WBR, Sergey
> 
Hello Sergey,

is it necessary to induce resource relocation by killing apache? I would use
'crm migrate resAPACHE' on the active node (for example). You must not forget to
finish with 'crm unmigrate resAPACHE' at some point in your examples, otherwise
'resAPACHE' would not return to your formerly active node in any case ;)
It is possible I think, but I am not that far yet. 

BTW: why do you use 'lsb:httpd' instead of 'ocf:heartbeat:apache' ? The
pacemaker resource agent is much more reliable in a cluster structure. Killing
'resAPACHE' using the ocf agent produces migration-threshold (infinity) and
fail-count (+1) scores which surely can be used to move the resource to another
node. I, too, am still learning how that is achieved.

Greets

Thomas





More information about the Pacemaker mailing list