[ClusterLabs] Resource stop when another resource run on that node
Ken Gaillot
kgaillot at redhat.com
Wed Jul 1 13:57:32 UTC 2015
On 07/01/2015 01:18 AM, John Gogu wrote:
> Hello,
> this is what i have setup but is now working 100%:
>
> Online: [ node01hb0 node02hb0 ]
> Full list of resources:
> IP1_Vir (ocf::heartbeat:IPaddr): Started node01hb0
> IP2_Vir (ocf::heartbeat:IPaddr): Started node02hb0
>
>
> default-resource-stickiness: 2000
>
>
> Location Constraints:
> Resource: IP1_Vir
> Enabled on: node01hb0 (score:1000)
>
> Resource: IP2_Vir
> Disabled on: node01hb0 (score:-INFINITY)
>
> Colocation Constraints:
> IP2_Vir with IP1_Vir (score:-INFINITY)
>
> When i move manual the resource IP1_Vir from node01hb0 > node02hb0 all is
> fine, IP2_Vir is stopped.
That's what you asked it to do. :)
The -INFINITY constraint for IP2_Vir on node01hb0 means that IP2_Vir can
*never* run on that node. The -INFINITY constraint for IP2_Vir with
IP1_Vir means that IP2_Vir can *never* run on the same node as IP1_Vir.
So if IP1_Vir is on node02hb0, then IP2_Vir has nowhere to run.
If you want either node to be able to take over either IP when
necessary, you don't want any -INFINITY constraints. You can use a score
other than -INFINITY to give a preference instead of a requirement.
For example, if you want the IPs to run on different nodes whenever
possible, you could have a colocation constraint IP2_Vir with IP1_Vir
score -3000. Having the score more negative than the resource stickiness
means that when a failed node comes back up, one of the IPs will move to
it. If you don't want that, use a score less than your stickiness, such
as -100.
You probably don't want any location constraints, unless there's a
reason each IP should be on a specific node in normal operation.
> When i crash node node01hb0 / stop pacemaker > both resources are stopped.
This likely depends on your quorum and fencing configuration, and what
versions of software you're using.
More information about the Users
mailing list