Forum Discussion
John_Boyd_45868
Nimbostratus
Jun 29, 2006using a new pool based on cookie
Because of a concurrency bug in our application I'm trying to only allow one appserver to write to our database. I removed 1 of the 4 appservers from our "main" pool and put it into its own pool "log...
Deb_Allen_18
Jun 30, 2006Historic F5 Account
It actually looks like the basic rule logic is good (simple enough!), but the logging is picking up some random header info instead of the actual cookie values, and the selected pool also won't be known until the LB_SELECTED event.
So let's clean up the test as citizen elah suggested, add an LB_SELECTED event, grab the server-set cookie values, and test again:
when HTTP_RESPONSE {
if { [HTTP::header exists Set-Cookie] } {
log "If: server is setting these cookies: [HTTP::header Set-Cookie]"
}
}
when HTTP_REQUEST {
log "Current pool is [LB::server pool]"
if {[HTTP::cookie exists username]} {
log "If: username cookie from client, contents are: [HTTP::cookie username]"
use pool login1
} else {
log "Else: No username cookie from client"
use pool main
}
}
when LB_SELECTED {
log "Selected pool is [LB::server pool]"
}Post back with more info if you run into further trouble.
HTH
/deb
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