I am testing the following iRule to persist on jsession for three clustered apps, which so far is working. While testing, I see that when I disable a node, the sessions continue to persist to the disabled node. It is only when I take down the app servers and the health check fails that persistence drops and persists to another node. Is this normal behavior? Any ideas on how to drop/move sessions when a node with persistent connections is disabled? Thanks
when HTTP_REQUEST {
if { [HTTP::cookie exists “JSESSIONID”] and [HTTP::uri] contains “/app1/” or [HTTP::uri] contains “/app2/” or [HTTP::uri] contains “/app3/” } {
persist uie [HTTP::cookie “JSESSIONID”]
} else {
set jsess [findstr [HTTP::uri] “jsessionid” 11 “;”]
if { $jsess != “” and [HTTP::uri] contains “/app1/” or [HTTP::uri] contains “/app2/” or [HTTP::uri] contains “/app3/”} {
So “Only active connections allowed” is “Forced down” under 4.x. I was wondering where that option went. Thanks for the info.
I saw this iRule in another post:
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists “JSESSIONID”] and $add_persist }
{ persist add uie [HTTP::cookie “JSESSIONID”]
set add_persist 0
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists “JSESSIONID”] } {
persist uie [HTTP::cookie “JSESSIONID”]
} else {
set jsess [findstr [HTTP::uri] “jsessionid” 11 “;”]
if { $jsess != “” } {
persist uie $jsess
}
}
}
Can anyone help out with an explanation of the HTTP_RESPONSE persist? For my scenario of persisting only to three apps based on the jsessionid, it doesn’t seem necessary, but I want to make sure that I am not missing something.