10.09.2018 22:46, Vassilis Aretakis пишет: > Hi All, > > I have a Pacemaker which failovers IPs around 5 nodes. I want to add an > default Route on each node, when this node has at least one of the > resources running. > > > The resources are: > > vip1-19 (ocf::heartbeat:IPaddr2): Started b01. > vip1-20 (ocf::heartbeat:IPaddr2): Started bm02. > vip1-21 (ocf::heartbeat:IPaddr2): Started eworker01. > vip1-22 (ocf::heartbeat:IPaddr2): Started eworker02. > vip1-23 (ocf::heartbeat:IPaddr2): Started eworker03. > vip1-24 (ocf::heartbeat:IPaddr2): Started b02. > vip1-25 (ocf::heartbeat:IPaddr2): Started eworker01. > vip1-26 (ocf::heartbeat:IPaddr2): Started eworker02. > vip1-27 (ocf::heartbeat:IPaddr2): Started b01. > vip1-28 (ocf::heartbeat:IPaddr2): Started eworker03. > vip1-29 (ocf::heartbeat:IPaddr2): Started eworker01. > vip1-30 (ocf::heartbeat:IPaddr2): Started eworker02. > > The Resource which brings up the Route is: > > Clone Set: r1-clone [r1] > Started: [ b01. b02. eworker01. eworker02. eworker03. ] > > If one nodes starts then the r1-clone cannot start, because it has no IP > assigned on that interface and therefore cannot add route. > I have to manually cleanup this resource to make it work. > > What do you suggest to make these resources always come up after at > least one ip is running on the servers? >
The only "native" way I can think of is using clones. If you can allocate consecutive range of IP addresses, you may consider a) create IPAddr2 clone with unique_clone_address=true. This will create unique IP address for every clone instance b) create Route clone with interleave=true and order/colocate with IPAddr2 clone It seems that pacemaker allows (undocumented) ordering/colocation against individual clone instances, which means you still can manage relationship with other resources requiring specific IP. Downside is that you will likely need to maintain CIB directly using XML. Also I am not exactly sure what happens when additional IPaddr2 instance will be started - will pacemaker restart dependent Route instance? Otherwise the most straightforward way is probably to modify IPaddr2 and add support for notifications - add route when the first instance is started and remove route when the last instance is stopped. _______________________________________________ Users mailing list: [email protected] https://lists.clusterlabs.org/mailman/listinfo/users Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://bugs.clusterlabs.org
