[Pacemaker] Ordering clones and primitives

Dejan Muhamedagic dejanmm at fastmail.fm
Tue Nov 2 12:25:30 UTC 2010


Hi,

On Sat, Oct 30, 2010 at 01:55:33PM -0400, Lars Kellogg-Stedman wrote:
> I have a two node cluster that hosts two virtual ips on the same network:
> 
>  primitive proxy_0_ip ocf:heartbeat:IPaddr \
>    params ip="10.10.10.20" cidr_netmask="255.255.255.0" nic="eth3"
>  primitive proxy_1_ip ocf:heartbeat:IPaddr \
>    params ip="10.10.10.30" cidr_netmask="255.255.255.0" nic="eth3"
> 
> After the ip address comes up, the system must establish a network
> route and a default route.  I'm having trouble defining the
> relationships between these services.  I started with this:
> 
>  primitive public_net_route ocf:heartbeat:Route \
>    params destination="10.10.10.0/24"
>    device="eth3" table="1"
>  primitive public_def_route ocf:heartbeat:Route \
>    params destination="default" gateway="10.10.10.1"
>    device="eth3" table="1"
> 
>  clone clone_public_def_route public_def_route
>  clone clone_public_net_route public_net_route
> 
> But having got this before, I don't understand how to estbalish the
> necessary ordering between the routes and the ip address resources.
> The clones can't come up on a host until one of the ip addresses are
> available on the host.  In other words, the cloned resources cannot be
> active on a host unless an ip address resource is also active on that
> host.
> 
> I tried this:
> 
>  order ip_0_before_routes inf: proxy_0_ip clone_public_net_route
>  order ip_1_before_routes inf: proxy_1_ip clone_public_net_route
>  order net_route_before_def_route \
>    inf: clone_public_net_route clone_public_def_route
> 
> ...but the clone services in this case don't start unless both ips are
> started.  Shutting down either ip takes down *all* of the clone
> resources on both nodes.

You should set the interleave=true meta attribute for the clones.
Hope that that would help. You need collocations as well.

Thanks,

Dejan

> Is it possible to do what I want?  This seems like exactly the same
> relationship that would exist betwee, say, a cloned Apache instance
> and a set of ip address resources, but I can't find a good example.
> 
> Thanks!
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker



More information about the Pacemaker mailing list