Forum Discussion

John_Cavell_344's avatar
John_Cavell_344
Icon for Nimbostratus rankNimbostratus
Dec 15, 2017

Catch-22 problem with health monitor

We are trying to overcome a "catch-22" situation with a load balancer VIP - any suggestions will be appreciated...

 

The VIP has a pool with 2 member nodes. The health monitor tests a specific URL on each node so that if one goes down all traffic will be sent to the other node.

 

The problem is when BOTH nodes are down (for example when starting the application after maintenance) - the application startup has a dependency on a call back to the load balancer VIP to retrieve the same URL that is used by the health monitor. But the health monitors haven't realized the URL is back up so traffic doesn't get to the member nodes and the application start-up fails.

 

So we need to use the health monitors to support fail-over if one of the nodes goes down during normal operation, but if both nodes go down we need to keep sending traffic through to allow the application to start back up.

 

Thanks in advance...

 

1 Reply

  • This is not to hard I think, you need to copy your original pool but do not put any monitors on it or put a simple monitor like a TCP or TCP Half Open just to ensure the servers are up.

    Then you need an iRule to check default pools active member status:

    when CLIENT_ACCEPTED {
         Set backup pool name to variable
        set backupPool "backup_pool"
    
        if {[active_members [LB::server pool]] < 1} {
            if {[active_members $backupPool] > 0} {
                log local0.alert "Default pool [LB::server pool] as not active members, forwarding to $backupPool"
                pool $backupPool
    
            } else {
                log local0.alert "Both default pool [LB::server pool] and $backupPool have no active members. Closing TCP connection"
                TCP::close
            }
        }
    }
    

    Backup pool name is set to a variable at the start of the iRule and you can also change the final TCP::close if you wanted to do some other response like a sorry page etc.