Forum Discussion
Maria_Ramirez_5
Nimbostratus
Feb 09, 2007weblogic persistenca does not works
Good morning,
I have a problem with iRules.
I have a pool with two weblogic servers. I want to maintain persistence based on cookies.
I create a virtual server for the pool of the two weblogic servers and I associate the iRules to the virtual server. But the persistence does not work. The traffic is always loadbalanced between the two nodes. Please can you help me? The iRules are:
* Servidor Web
when HTTP_REQUEST {
if { [HTTP::cookie exists WEBSRV] } {
persist uie [HTTP::cookie WEBSRV];
}
}
when HTTP_RESPONSE {
if { not [HTTP::cookie exists WEBSRV ] } {
set ip_srv [IP::server_addr];
set valor [ string range $ip_srv [ expr [string last . $ip_srv ] + 1] 15];
set val_cookie "WEBSRV=$valor; path=/"
HTTP::header insert Set-Cookie $val_cookie;
persist add uie $valor;
}
}
* Weblogic
when HTTP_REQUEST {
if { [HTTP::cookie exists WLSRV] } {
persist uie [HTTP::cookie WLSRV];
}
}
when HTTP_RESPONSE {
if { not [HTTP::cookie exists WLSRV ] } {
set ip_srv [IP::server_addr];
set valor [ string range $ip_srv [ expr [string last . $ip_srv ] + 1] 15];
set val_cookie "WLSRV=$valor; path=/"
HTTP::header insert Set-Cookie $val_cookie;
persist add uie $valor;
}
}
Thanks and regards
- Charles_Harris
Nimbostratus
Are your WLS nodes clustered? - Wes_98712
Nimbostratus
If you want to persist based on a specific cookie that has been programmed into the application, I would suggest you get the name and the length and simply use a cookie hash profile, this is the most efficient that I have found rather than trying to control it via an iRule. - Maria_Ramirez_5
Nimbostratus
Hello Wes - Maria_Ramirez_5
Nimbostratus
Hi again, - Wes_98712
Nimbostratus
Sorry this is so late, must have missed the alert, hopefully you found it, if not you simply need to create a cookie profile using a hash, for the cookie name use JSESSIONID. The cluster does not determine whether or not you use a JSESSIONID, most containers use them, unless turned off, which no one should do unless they are storing the session information in a different cookie.
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