Forum Discussion

BOJO3811_131898's avatar
BOJO3811_131898
Icon for Nimbostratus rankNimbostratus
Feb 08, 2015

Perform a health check on a redirecting irule

I am trying to setup an irule to redirect traffic with the uri "/genlogin" to separate ports on the same node, 7003 and 7013. They redirects are working fine...however when we disable the 7003 service it will still try to redirect to the down pool member. It looks like i need to try to setup a health check on the node before the redirect takes place. Problem is i have no idea how to do it. Any help will be appreciated.

VIP: asgenqa:80 Pool: asgen-qa Members: xxx.xxx.xxx.xxx:7003 xxx.xxx.xxx.xxx:7013

Irule:

when CLIENT_ACCEPTED {   
   set count [expr { rand() }] 
   }   
 when HTTP_REQUEST {
    if { [HTTP::uri] equals "/genlogin" } {
        if { $count < .5 } {     
       HTTP::redirect "http://asgen-qa:7003/fa_sc/domain"
     } else {    
       HTTP::redirect "http://asgen-qa:7013/fa_sc/domain"
       }
}
elseif { [HTTP::uri] equals "/" } {
        set count [expr { rand() }] 
        if { $count < .5 } {     
       HTTP::redirect "http://asgen-qa:7008/FA_Portal"
     } else {    
       HTTP::redirect "http://asgen-qa:7018/FA_Portal"
       }
    } 
    }

1 Reply

  • From the looks of you iRule, since you're not doing any kind of checking to whether the node is available, you will run into problems.

     

    Check out the wiki pages for pool, LB::status, and the iRules 101 page for help on doing these kinds of checks.

     

    Then I'd suggest testing the status of the node, and you may even want to look at the LB_FAILED event to re-select a different node in case there's an issue.