I found a solution.
I made the mistake to define two pingd resources. Both of them had its own
dampen=60s, but they are completely independent.
The solution is to define a clone - pingd resource.
This is my config, which works fine:
<clone id="resource_pingd_clone_dbma0304_gateway_reachable">
<meta_attributes
id="resource_pingd_clone_dbma0304_gateway_reachable-meta_attributes">
<nvpair
id="resource_pingd_clone_dbma0304_gateway_reachable-meta_attributes-target-role"
name="target-role" value="Started"/>
</meta_attributes>
<primitive class="ocf" id="pingd_dbma0304_gateway_reachale"
provider="pacemaker" type="ping">
<operations id="pingd_dbma0304_gateway_reachale-operations">
<op id="pingd_dbma03_gateway_reachale-op-monitor-5" interval="5"
name="monitor" timeout="5"/>
</operations>
<instance_attributes
id="pingd_dbma0304_gateway_reachale-instance_attributes">
<nvpair
id="pingd_dbma0304_gateway_reachale-instance_attributes-host_list"
name="host_list" value="defaultgateway.domain"/>
<nvpair
id="pingd_dbma0304_gateway_reachale-instance_attributes-name" name="name"
value="gateway_reachable"/>
<nvpair
id="pingd_dbma0304_gateway_reachale-instance_attributes-dampen" name="dampen"
value="60"/>
<nvpair
id="pingd_dbma0304_gateway_reachale-instance_attributes-timeout" name="timeout"
value="5"/>
<nvpair
id="pingd_dbma0304_gateway_reachale-instance_attributes-attempts"
name="attempts" value="2"/>
<nvpair
id="pingd_dbma0304_gateway_reachale-instance_attributes-multiplier"
name="multiplier" value="100"/>
</instance_attributes>
</primitive>
</clone>
..........................
<constraints>
<rsc_location id="dbma03_base_group_default" node="dbma03"
rsc="resource_dbma03s_ip" score="500"/>
<rsc_location id="dbma04_base_group_default" node="dbma04"
rsc="resource_dbma04s_ip" score="500"/>
<rsc_location id="location_resource_dbma03s_ip_ping_depending"
rsc="resource_dbma03s_ip">
<rule id="xping-resource_dbma04s_ip-03-normal-state" score="-INFINITY">
<expression attribute="gateway_reachable"
id="xping-resource_dbma04s_ip-03-normal-state-rule-condition1" operation="lt"
type="number" value="100"/>
<expression attribute="#uname"
id="xping-resource_dbma04s_ip-03-normal-state-rule-condition2" operation="eq"
value="dbma04"/>
</rule>
<rule id="rule-resource_dbma03s_ip-standard-location" score="+1500">
<expression attribute="gateway_reachable"
id="ping-resource_dbma03s_ip-03-normal-state-rule-condition1" operation="eq"
type="number" value="100"/>
<expression attribute="#uname"
id="ping-resource_dbma03s_ip-03-normal-state-rule-condition2" operation="eq"
value="dbma03"/>
</rule>
<rule id="ping-resource_dbma04s_ip-03-normal-state" score="+1000">
<expression attribute="gateway_reachable"
id="ping-resource_dbma04s_ip-03-normal-state-rule-condition1" operation="eq"
type="number" value="100"/>
<expression attribute="#uname"
id="ping-resource_dbma04s_ip-03-normal-state-rule-condition2" operation="eq"
value="dbma04"/>
</rule>
</rsc_location>
<rsc_location id="location_resource_dbma04s_ip_ping_depending"
rsc="resource_dbma04s_ip">
<rule id="Xping-resource_dbma03s_ip-04-normal-state" score="-INFINITY">
<expression attribute="gateway_reachable"
id="Xping-resource_dbma03s_ip-04-normal-state-rule-condition1" operation="lt"
type="number" value="100"/>
<expression attribute="#uname"
id="Xping-resource_dbma03s_ip-04-normal-state-rule-condition2" operation="eq"
value="dbma03"/>
</rule>
<rule id="rule-resource_dbma04s_ip-standard-location" score="+1500">
<expression attribute="gateway_reachable"
id="ping-resource_dbma04s_ip-04-normal-state-rule-condition1" operation="eq"
type="number" value="100"/>
<expression attribute="#uname"
id="ping-resource_dbma04s_ip-04-normal-state-rule-condition2" operation="eq"
value="dbma04"/>
</rule>
<rule id="ping-resource_dbma03s_ip-04-normal-state" score="+1000">
<expression attribute="gateway_reachable"
id="ping-resource_dbma03s_ip-04-normal-state-rule-condition1" operation="eq"
type="number" value="100"/>
<expression attribute="#uname"
id="ping-resource_dbma03s_ip-04-normal-state-rule-condition2" operation="eq"
value="dbma03"/>
</rule>
</rsc_location>
</constraints>
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Andrew Beekhof
Sent: Mittwoch, 24. März 2010 15:39
To: General Linux-HA mailing list
Subject: Re: [Linux-HA] pingd - rules - problem
On Wed, Mar 24, 2010 at 2:49 PM, Scheffler Heinz <[email protected]> wrote:
> I use dumpen="60s" until my first tests.
Perhaps make it higher.
> Maybe the order of the rules are relevant?
Shouldn't be.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Scheffler
> Heinz
> Sent: Mittwoch, 24. März 2010 14:12
> To: General Linux-HA mailing list
> Subject: Re: [Linux-HA] pingd - rules - problem
>
> My DTD requires type="number". Anyway, it is a cosmetically correction - the
> behavior of the cluster is the same. "Number" seems to be the default.
> The rules are working correct 90% works good. There is a timing problem,
> depending on which node detects the lost defaultgateway first.
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Andrew
> Beekhof
> Sent: Mittwoch, 24. März 2010 11:54
> To: General Linux-HA mailing list
> Subject: Re: [Linux-HA] pingd - rules - problem
>
> Expressions like these:
>
> <expression attribute="dbma04_gateway_reachable"
> id="xping-resource_dbma04s_ip-03-normal-state-rule-condition1"
> operation="lt" value="100"/>
>
> Should include type="integer" so that the cluster does the correct type of
> comparison.
> Try that and let us know if it improves things.
>
> On Wed, Mar 24, 2010 at 11:45 AM, Scheffler Heinz <[email protected]>
> wrote:
>> Hello
>>
>> I have a corosync-pacemaker Cluster with two nodes (mutual takeover). All
>> resource locations on one node depending on the nodes network connectivitiy.
>> pingd-depending rules for the ip interfaces in a base - group and then
>> colocations for all other groups. I wrote rules around pingd for the
>> following situations:
>>
>> Notation:
>>
>> - Node a
>>
>> - Node b
>>
>> - "ip a" is the ip interface resource on node a
>>
>> - "ip b" is the ip interface resource on node b
>>
>> - pingd resource for a, running on node a (with score infinity), host
>> to ping is the default gateway, dampen 60s, operations interval 5s,
>> operations timeout 25s
>>
>> - pingd resource for b, running on node b (with score infinity),
>> host to ping is the default gateway, dampen 60s, operations interval
>> 5s, operations timeout 25s
>>
>> (both nodes are in one subnet with one gateway)
>>
>>
>>
>> The Rules:
>>
>> base location - score for ip a on node a = 500
>>
>> base location - score for ip b on node b = 500
>>
>>
>>
>> if node a can ping the defaultgateway then score for ip a on node a =
>> +1500
>>
>>
>> if node b can ping the defaultgateway then score for ip a on node b =
>> +1000
>>
>>
>> if node b can't ping defaultgateway then score for ip a on node b =
>> -INFINITY
>>
>>
>>
>> if node b can ping the defaultgateway then score for ip b on node b =
>> +1500
>>
>>
>> if node a can ping the defaultgateway then score for ip b on node a =
>> +1000
>>
>>
>> if node a can't ping defaultgateway then score for ip b on node a =
>> -INFINITY
>>
>>
>>
>> What I want:
>>
>> If one node can't reach the defaultgateway, all resources running on that
>> node, should switch to the other node, IF the other node can still reach the
>> defaultgateway.
>>
>> If the "other" node also can't reach the defaultgateway, nothing should
>> happen and all resources should stay on the node they are currently running.
>>
>>
>>
>> The Problem:
>>
>> If I unplug the network cable on both nodes (at one time), the resources
>> should stay on the node they are currently running. BUT one node detects the
>> failed gateway ping earlyer, so the cluster trys to switch its resources.
>> After a short time, the other node detects the failed gateway and all
>> switched resources goes back to the node they running before. I thought the
>> attribute "dumpen" is the solution to handle this problem? All other cases
>> are working fine.
>>
>>
>>
>> The Config (constraints section only):
>>
>> <constraints>
>>
>> <rsc_location id="location_dbma03_gateway_reachable" node="dbma03"
>> rsc="resource_pingd_dbma03_gateway_reachable" score="+INFINITY"/>
>>
>> <rsc_location id="location_dbma04_gateway_reachable" node="dbma04"
>> rsc="resource_pingd_dbma04_gateway_reachable" score="+INFINITY"/>
>>
>> <rsc_location id="dbma03_base_group_default" node="dbma03"
>> rsc="resource_dbma03s_ip" score="500"/>
>>
>> <rsc_location id="dbma04_base_group_default" node="dbma04"
>> rsc="resource_dbma04s_ip" score="500"/>
>>
>> <rsc_location id="location_resource_dbma03s_ip_ping_depending"
>> rsc="resource_dbma03s_ip">
>>
>> <rule id="rule-resource_dbma03s_ip-standard-location" score="+1500">
>>
>> <expression attribute="dbma03_gateway_reachable"
>> id="ping-resource_dbma03s_ip-03-normal-state-rule-condition1"
>> operation="eq" value="100"/>
>>
>> <expression attribute="#uname"
>> id="ping-resource_dbma03s_ip-03-normal-state-rule-condition2"
>> operation="eq" value="dbma03"/>
>>
>> </rule>
>>
>> <rule id="ping-resource_dbma04s_ip-03-normal-state" score="+1000">
>>
>> <expression attribute="dbma04_gateway_reachable"
>> id="ping-resource_dbma04s_ip-03-normal-state-rule-condition1"
>> operation="eq" value="100"/>
>>
>> <expression attribute="#uname"
>> id="ping-resource_dbma04s_ip-03-normal-state-rule-condition2"
>> operation="eq" value="dbma04"/>
>>
>> </rule>
>>
>> <rule id="xping-resource_dbma04s_ip-03-normal-state"
>> score="-INFINITY">
>>
>> <expression attribute="dbma04_gateway_reachable"
>> id="xping-resource_dbma04s_ip-03-normal-state-rule-condition1"
>> operation="lt" value="100"/>
>>
>> <expression attribute="#uname"
>> id="xping-resource_dbma04s_ip-03-normal-state-rule-condition2"
>> operation="eq" value="dbma04"/>
>>
>> </rule>
>>
>> </rsc_location>
>>
>> <rsc_location id="location_resource_dbma04s_ip_ping_depending"
>> rsc="resource_dbma04s_ip">
>>
>> <rule id="rule-resource_dbma04s_ip-standard-location" score="+1500">
>>
>> <expression attribute="dbma04_gateway_reachable"
>> id="ping-resource_dbma04s_ip-04-normal-state-rule-condition1"
>> operation="eq" value="100"/>
>>
>> <expression attribute="#uname"
>> id="ping-resource_dbma04s_ip-04-normal-state-rule-condition2"
>> operation="eq" value="dbma04"/>
>>
>> </rule>
>>
>> <rule id="ping-resource_dbma03s_ip-04-normal-state" score="+1000">
>>
>> <expression attribute="dbma03_gateway_reachable"
>> id="ping-resource_dbma03s_ip-04-normal-state-rule-condition1"
>> operation="eq" value="100"/>
>>
>> <expression attribute="#uname"
>> id="ping-resource_dbma03s_ip-04-normal-state-rule-condition2"
>> operation="eq" value="dbma03"/>
>>
>> </rule>
>>
>> <rule id="Xping-resource_dbma03s_ip-04-normal-state"
>> score="-INFINITY">
>>
>> <expression attribute="dbma03_gateway_reachable"
>> id="Xping-resource_dbma03s_ip-04-normal-state-rule-condition1"
>> operation="lt" value="100"/>
>>
>> <expression attribute="#uname"
>> id="Xping-resource_dbma03s_ip-04-normal-state-rule-condition2"
>> operation="eq" value="dbma03"/>
>>
>> </rule>
>>
>> </rsc_location>
>>
>> </constraints>
>>
>>
>>
>> Thanks
>>
>> Heinz
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> <https://img.web.de/p.gif>
>> WEB.DE DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.!
>> http://produkte.web.de/go/02/
>>
>> _______________________________________________
>> Linux-HA mailing list
>> [email protected]
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha
>> See also: http://linux-ha.org/ReportingProblems
>>
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems