Forum Discussion

tractor's avatar
tractor
Icon for Nimbostratus rankNimbostratus
Jul 06, 2016

reset connections to lower priority group member when higher-ranked member is available

Application is designed such that traffic needs to go to the "main" server whenever it's available. Traffic should only go to the "standby" pool member(s) if the main node drops from the pool. (this has been achieved with a priority group, no problem.)

 

When "main" node comes back online, new connections will go to it (this is good) but existing connections will stick to the 'standby' pool member (this is the undesired behavior).

 

I've found iRule examples such as in https://devcentral.f5.com/questions/priority-group-failback that describe how one could do this for HTTP requests, but unfortunately these aren't HTTP sessions in my case -- so the 'when HTTP_REQUEST_SEND' event doesn't apply. I skimmed through https://devcentral.f5.com/wiki/iRules.Events.ashx and couldn't find anything that seemed applicable, and the various things I tried didn't seem to work.

 

Am I missing something easy here?

 

2 Replies

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Try this one:

    when LB_SELECTED {
        if { [LB::status pool poolname member 10.0.0.1 80 ] equals "up" and [IP::addr [LB::server addr] equals 10.0.0.2] } {
            LB::reselect pool poolname member 10.0.0.1
        }
    }
    
  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Or, if you have problem with LB::reselect, you may force the end-user to re-connect:

    when LB_SELECTED {
        if { [LB::status pool poolname member 10.0.0.1 80 ] equals "up" and [IP::addr [LB::server addr] equals 10.0.0.2] } {
            drop
        }
    }