Forum Discussion

Mark_Fenkner_60's avatar
Mark_Fenkner_60
Icon for Nimbostratus rankNimbostratus
Apr 23, 2007

sub-pools for failover?

I'm setting up a VIP for an application with four nodes in two clustered pairs (node1 & node2 and node3 & node4). The app owner wants the VIP to evenly distribute traffic across all four nodes with cookie persistence, but in the case of a failure to only failover persistent connections to the other node in the cluster. So node1 & node2 can failover between them, and the same with node3 & node4. Is there a way to implement this with iRules? Any tips would be appreciate.

 

 

Thanks!

 

 

Mark
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    It sounds like what you need is a pair of pools, and an iRule to distribute between them.

    That way you could have the iRUle round robin between the pools, and have each clustered pair in its own pool. When one member of either pool went down, the failover would be handled by the pool's configuration. The iRule would just keep passing requests to each pool in turn and the remaining operational node would get the traffic.

    Basically two layers of round robin load balancing, does that make sense?

    The iRule would be quite straightforward. Assuming you're talking about an HTTP application it'd be something like:

    
    when HTTP_REQUEST {
      if { $myPool equals "pool1" } {
        set myPool "pool2"
      } else {
        set myPool "pool1"
      }
      pool $myPool
    }

    HTH,

    Colin
    • brad_11480's avatar
      brad_11480
      Icon for Nimbostratus rankNimbostratus

      I'm reading that the above is an illustrative example. I'm surprised it is at a HTTP_REQUEST event and it isn't clear how the persistence is carried and on failure that the selection is in the same pool. But perhaps it doesn't matter since the persistence will dictate the member for the requests once it has been established and this code in the HTTP_REQUEST doesn't alter that.

       

      Okay then to complicate it if all members of one pool are unavailable - become unavailable it needs to select a member of the other pool. If the pool is explicitly stated then how does it know what the 'fallback' pool is for the other group? Thanks!!!!