Forum Discussion

atomicdog_7107's avatar
atomicdog_7107
Icon for Nimbostratus rankNimbostratus
Mar 08, 2012

Priority Group activation and preempt

Hey guys,

 

 

I have a few pools set up just for redundancy purposes with a preferred primary server... so 2 pool members with Priority Group Activation set to fail at "Less than 1 available member". So if they primary fails health checks, it fails to the secondary.

 

 

Not rocket science and it works just fine, until there is a failure, because this application really needs the sessions to be forced back to the primary (persistent or not) once the primary server begins to pass health checks again. In other words, I need Priority Group Activation with graceful preempt. Does anyone know of a way to set this up?

 

 

Thanks as always!

 

2 Replies

  • Is this for HTTP? If so, you could add the two servers to separate pools. You could then use an iRule to check in each HTTP_REQUEST event to see if the primary pool is up and select that. Else, if it's not, use the secondary pool. If both are down, you could take some failsafe action like send an HTTP response from the iRule or a redirect to some other URL.

    The downside to this is you'd need two pools per virtual server. The upside is the iRule is much simpler than trying to modify the logic of priority groups.

    
    when CLIENT_ACCEPTED {
    
     Save the VS pool name and use it as the default
    set default_pool [LB::server pool]
    }
    when HTTP_REQUEST {
    
     If the default pool is up, use it
    if {[active_members $default_pool] == 0}{
    
     If the secondary pool is up use it
    if {[active_members secondary_pool]}{
    pool secondary_pool
    } else {
     Take some action?
    
     Redirect
    HTTP::redirect "http://maintenance.example.com/down.html"
    
     Send an HTTP response
    HTTP::respond 503 content {Sorry we are down now}
    }
    }
    }
    

    Aaron
  • Thanks for the reply Aaron. I've been meaning to get back to update this. I was able to solve this by working with the app owner to modify their app so that it no longer requires persistence. Without persistence when a failure occurs and the primary comes back online the connections preempt right back to it... so it is working like a champ now.

     

     

    Having said that... I really like your iRule. It has given me some other ideas for a few other apps that I have. Thanks for your response!