Forum Discussion

Florin_Andrei_2's avatar
Florin_Andrei_2
Icon for Nimbostratus rankNimbostratus
Mar 09, 2010

multiple pools with one virtual server

Situation:

 

 

Two data centers, A and B. Each one has a load balancer. Each load balancer has a virtual server. Each virtual server points to a local pool of servers.

 

 

So, virtual server A on load balancer A uses pool of servers A, and v.s. B uses pool B. So far so good.

 

 

I am trying to find out whether a virtual server can have more than one pool, and switch to the "backup pool" if the primary pool goes down. Basically, add pool B to virtual server A (on load balancer A), and have it take over the virtual server if pool A goes down.

 

 

Is there a way to do that?

 

 

The reason why I'm trying to do it:

 

 

The two data centers are disaster recovery sites, and the clients are sent to one site or another based on DNS. But some clients (Explorer) ignore the DNS TTL so remain stuck on one site.

 

 

So, if clients are stuck on site B while they should really go to site A, I would like the load balancer B to automatically add pool A to virtual server B - this way the clients are automatically routed internally to the right servers. This assumes the internal routing between sites still works.

4 Replies

  • This sounds like a good use case for priority group activation. Put the servers in the priority group as 'backup' so when n number of systems from the local pool go offline (or all of them) you can spin up the members at the remote site. Check the manuals on ask.f5.com for information on setting this up. It's quite straight forward.

     

     

    Also, you could do this with an iRule and force a redirect over to the other site.

     

     

    -Matt
  • Hi Florin,

     

    If you have v10 you could also look into using iSessions (Click here. Basically iSessions creates a secure tunnel between two BIG-IP systems to share in load-balancing and failover.

     

     

    Bhattman
  • Yes, I think I could do it with priority group activation. I was wondering if there's a way to do it so that the two groups of servers are more neatly separated.

     

     

    These are two geographically separate data centers, and I'd like to keep the "populations" of servers as separate as possible in the config.

     

     

    How could the group switch be accomplished via an iRule? If possible, that would do exactly what I want.

     

     

    ------

     

     

    The real situation is a bit more complicated. There are two GTM units, one for each site, and they declare a site failed based on the status of its virtual server. With the pool switchover, that will be tricky (the local site has failed, but the virtual server is still working, because it has flipped the pools).

     

     

    I'll have to tell the GTMs to declare the site failed not only if the virtual server is down, but also if the pool behind that virtual server is the non-local one.

     

     

    I can't imagine how I could do that, other than having the two pools respond in different ways to the GTM test (therefore breaking the perfect symmetry of the content - currently they are 100% identical) so that the GTM can tell whether the response comes from a server on site A or on site B. It would be just one file after all, not too bad. But I'm still looking for a better solution.
  • So how about this:

     
     when CLIENT_ACCEPTED { 
     if { ([active_members pool_A] < 1) and ([active_members pool_B] >= 1) } { 
     pool pool_B 
     } 
     if { ([active_members pool_B] < 1) and ([active_members pool_A] >= 1) } { 
     pool pool_A 
     } 
     } 
     

    Is there a better way to select the event than CLIENT_ACCEPTED? I'd rather not trigger the rule too often. Can I use LB_FAILED?

    So, the way to use this iRule is:

    - select the local pool as the default pool for the virtual server

    - add this iRule to the resources used by the virtual server.

    Correct?