Forum Discussion

Festus_50639's avatar
Festus_50639
Icon for Nimbostratus rankNimbostratus
Dec 01, 2008

"Select pool based on uri content" iRule doesn't seem to be working

Good morning,

 

 

I have an iRule that is designed to select a pool based on a string found in the uri and it doesn't seem to be working. I have a log that collects the uri for reference. The "test" rule I have in place that searches the uri and creates the "destination pool name" seems to be creating the pool name correctly, but when I put the "action" rule into place the http request hangs. Background and iRules are provided below.

 

 

Background:

 

 

 

-The VIP is listening on port 80 and has a default pool listening on 8981

 

 

-The web application being load balanced is Tibco ESB

 

 

-There are 25 separate services that are supported by this application and all are listening on different ports

 

 

-Individual pools are created with basic http monitor showing all pool members as "up"

 

 

-Our pools have a naming convention that has a string before and after the service name. (i.e. esb__pool)

 

 

-Use of "uri" and "test" rules yield the following log entries:

 

Dec 1 08:37:28 tmm tmm[1097]: Rule esb_pool-uri-log : ====VIP uri request is /eProxy/service/CreditCardService?wsdl====

 

Dec 1 08:37:28 tmm tmm[1097]: Rule esb_pool-mgr_test : ==ESB Tibco: Requested pool name is esb_CreditCardService_pool==

 

 

-Use of the "uri" and "action rules yield the following log entries:

 

ec 1 08:43:36 tmm tmm[1097]: Rule esb_pool-uri-log : ====VIP uri request is /eProxy/service/CreditCardService?wsdl====

 

Dec 1 08:43:36 tmm tmm[1097]: Rule esb_pool-mgr_action : ==ESB Tibco: Requested pool name is esb_CreditCardService_pool==

 

 

 

iRules:

 

 

"uri logging rule"

 

 

rule esb_pool-uri-log {

 

when HTTP_REQUEST {

 

set esb_uri [HTTP::uri]

 

log local0. "===="

 

log local0. "====VIP uri request is $esb_uri===="

 

 

}

 

}

 

++++++++++++++++++++++++++

 

 

"pool selection test rule"

 

rule esb_pool-mgr_test {

 

when HTTP_REQUEST {

 

set front "esb_"

 

set back "_pool"

 

set svc_uri [getfield [HTTP::uri] ? 1]

 

set svc_name [getfield $svc_uri "dir1/service/" 2]

 

set pool_name [concat $front$svc_name$back]

 

log local0. "==ESB Tibco: Requested pool name is $pool_name=="

 

}

 

}

 

++++++++++++++++++++++++++

 

 

"pool selection action rule"

 

rule esb_pool-mgr_action {

 

when HTTP_REQUEST {

 

set front "esb_"

 

set back "_pool"

 

set svc_uri [getfield [HTTP::uri] ? 1]

 

set svc_name [getfield $svc_uri "dir1/service/" 2]

 

set pool_name [concat $front$svc_name$back]

 

log local0. "==ESB Tibco: Requested pool name is $pool_name=="

 

 

if { [catch { pool $pool_name } ] } {

 

 

log local0. "====ERROR: Attempting to assign traffic to non-existant pool $pool_name===="

 

log local0. "====Sending traffic to default esb pool===="

 

pool esb_8981_pool

 

}

 

}

 

}

 

 

Is there something I am missing that is not sending the traffic to the correct pool?

 

 

Thanks,

 

Kevin

 

 

 

14 Replies