Forum Discussion
iRules to enable universal persistence not enabling persistence
Here's the setup:
I have a virtual server. I have 2 iRules (see below) assigned to it as resources.
From the server log it looks like that the rules are running and they select the correct member
from the pool after persisting the session (as far as I can tell based on my log messages), but the requests are ultimately directed to somewhere else.
Here's how both rules look like:
when HTTP_RESPONSE {
set sessionId [HTTP::header X-SessionId]
if {$sessionId ne ""} {
persist add uie $sessionId 3600
log local0.debug "Session persisted: <$sessionId> to <[persist lookup uie $sessionId]>"
}
}
when HTTP_REQUEST {
set sessionId [findstr [HTTP::path] "/session/" 9 /]
if {$sessionId ne ""} {
persist uie $sessionId
set persistValue [persist lookup uie $sessionId]
log local0.debug "Found persistence key <$sessionId> : <$persistValue>"
}
}
According to the log messages from the rules, the proper balancer members are selected.
Note: the two rules can not conflict, they are looking for different things in the path. Those two things never appear in the same path.
Notes about the server:
The default load balancing method is RR.
There is no persistence profile assigned to the virtual server.
I'm wondering if this should be adequate to enable the persistence, or alternatively, do I have
to combine the 2 rules and create a persistence profile with them for the virtual server?
Or is there something else that I have missed?
5 Replies
- nitass
Employee
have you tried oneconnect profile? - Zoltan_101727
Nimbostratus
Thanks, that looks like something worth looking into. - What_Lies_Bene1
Cirrostratus
Why are you trying to persist the server responses, that doesn't make sense? - Zoltan_101727
Nimbostratus
Not trying to persist server responses. I'm adding the server that server the request to the "persistence map" with the key that is in that response header (persist add uie ...) . Subsequent requests containing that same key will be server by the same server as the one that had the key/sessionid in the response (persists uie ...). At least that's the intent. - Zoltan_101727
Nimbostratus
As the link by nitass suggested, I've modified the rule to make sure that keep-alive connections are not interfering with the session persistence:
Recent Discussions
Related Content
* 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