Forum Discussion
Ian_Stewart_390
Nimbostratus
Oct 14, 2005iRules, URL Routing and Cookie Persistance
Hi Everyone,
We have a BigIP 1500, configured with several virtual servers and pools. We use an iRule to make routing decisions to direct traffic to the correct pool based on request URL, si...
Rupert_80016
Nimbostratus
Feb 26, 2009Hi all,
I've got a similar issue to the original poster.
I've writen an iRule which directs the client to the relevant pool based on URI however I'd also like them to persist once they get to that pool.
So far I've tried all the peristence methods, persistence records ARE being inserted in to the persistence table however whenever the client returns and the persistence is still valid, it's ignored, they are round robined to a new server and get a new persistence record.
Please could anyone shed any light on this, kinda tearing my hair out!!
Further info:
Datastore contents:
URIA!xxxx-80_pool!cookie!hash MYCOOKIE
Persistence table contents (this shows an initial connections and then a further request getting a new persistence record):
[root@myloadbalancer:Active] config b persist pool xxxx-80_pool show all
PERSISTENT CONNECTIONS --
Mode: cookie Value: VpHyJlKJdk
Virtual: 10.1.1.1:http Node: 10.2.2.2:12346 Age: 1sec
Mode: cookie Value: JlK8JlKLzs
Virtual: 10.1.1.1:http Node: 10.2.2.2:12346 Age: 6sec
iRule in question:
when HTTP_REQUEST {
parse the URI for the content provider, this is the first key
set content_provider [lindex [split [HTTP::uri] "/"] 1]
find the content provider in the data group
set idx [matchclass $::xxxx_httpuri_datastore contains $content_provider]
log "idx=$idx"
check if the content provider is in the conf
if {$idx > 0}{
if it is let's dance
set cfg [lindex $::xxxx_httpuri_datastore [expr $idx - 1]];
set lbpool [lindex [split $cfg "!"] 1];
set permethod [lindex [split $cfg "!"] 2];
set perargs [lindex [split $cfg "!"] 3];
if {$permethod equals "cookie"}{
persist cookie [lindex [split $perargs " "] 0] [lindex [split $perargs " "] 1];
use pool $lbpool;
} else {
persist $permethod;
use pool $lbpool;
}
} else {
content provider not in conf, drop connection
log "Sorry, Rejecting $content_provider not in conf."
reject
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects