Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Users

how to configure a resource to run on active node only

 

 

Linux-HA users RSS feed   Index | Next | Previous | View Threaded


smahesh at alcatel-lucent

Jun 29, 2009, 10:28 PM

Post #1 of 2 (316 views)
Permalink
how to configure a resource to run on active node only

Hi,

I have a setup with two nodes in the HA cluster. Both nodes share a virtual IP (bound to the currently active node). There are two resources 'A' and 'B' - with 'B' depending on 'A'. By default, resource 'A' runs on both nodes. I want resource 'B' to run on currently active node (the one bound to the virtual IP). It should only run on the passive node if the virtual IP migrates to the second node.

My question is - how to add the constraint rule for this scenario? Can I access the 'ip' instance attribute of the 'IPAddr' resource agent in the constraint rules?

I am looking for something similar to this.

<primitive id="virt_ip" class="ocf" type="IPaddr" provider="heartbeat">
<instance_attributes id="virt_ip_attr">
<attributes>
<nvpair id="virt_ip_ip" name="ip" value="10.10.10.10"/>
<nvpair id="virt_ip_mask" name="cidr_netmask" value="255.255.255.0"/>
<nvpair id="virt_ip_nic" name="nic" value="eth0"/>
</attributes>
</instance_attributes>
</primitive>

<rsc_location id="run_B_on_node2" rsc="B_node2">
<rule id="run_B_node2_rule" score="200" boolean_op="and">
<expression id="run_B_node2_rule_expr" attribute="#uname" operation="eq" value="NODE2"/>
<expression id="B_node2_virtualIP_rule_expr" attribute="#ip" operation="eq" value="10.10.10.10"/>
</rule>
</rsc_location>


I am not sure if "#ip" can be used in attribute.

Is there a better way to enforce this rule?


Thanks,
Mahesh
_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems


andrew at beekhof

Jun 30, 2009, 12:40 AM

Post #2 of 2 (281 views)
Permalink
Re: how to configure a resource to run on active node only [In reply to]

On Tue, Jun 30, 2009 at 7:28 AM, MAHESH, SIDDACHETTY M (SIDDACHETTY
M)<smahesh [at] alcatel-lucent> wrote:
> Hi,
>
>  I have a setup with two nodes in the HA cluster. Both nodes share a virtual IP (bound to the currently active node).

If the cluster software is running, then the node is active.

>There are two resources 'A' and 'B' - with 'B' depending on 'A'. By default, resource 'A' runs on both nodes. I want resource 'B' to run on currently active node (the one bound to the virtual IP). It should only run on the passive node if the virtual IP migrates to the second node.
>
>  My question is - how to add the constraint rule for this scenario?

Look up rsc_colocation in one of the
http://clusterlabs.org/wiki/Documentation pdfs

> Can I access the 'ip' instance attribute of the 'IPAddr' resource agent in the constraint rules?

No.

> I am looking for something similar to this.
>
> <primitive id="virt_ip" class="ocf" type="IPaddr" provider="heartbeat">
>        <instance_attributes id="virt_ip_attr">
>                <attributes>
>                        <nvpair id="virt_ip_ip" name="ip" value="10.10.10.10"/>
>                        <nvpair id="virt_ip_mask" name="cidr_netmask" value="255.255.255.0"/>
>                        <nvpair id="virt_ip_nic" name="nic" value="eth0"/>
>                </attributes>
>        </instance_attributes>
> </primitive>
>
> <rsc_location id="run_B_on_node2" rsc="B_node2">
>        <rule id="run_B_node2_rule" score="200" boolean_op="and">
>                <expression id="run_B_node2_rule_expr" attribute="#uname" operation="eq" value="NODE2"/>
>                <expression id="B_node2_virtualIP_rule_expr" attribute="#ip" operation="eq" value="10.10.10.10"/>
>        </rule>
> </rsc_location>
>
>
> I am not sure if "#ip" can be used in attribute.
>
> Is there a better way to enforce this rule?
>
>
> Thanks,
> Mahesh
> _______________________________________________
> Linux-HA mailing list
> Linux-HA [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Linux-HA users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.