[Pacemaker] Ordering clones and primitives

Lars Kellogg-Stedman lars at oddbit.com
Sat Oct 30 13:55:33 EDT 2010


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.

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!




More information about the Pacemaker mailing list