Forum Discussion
bdavis
Nimbostratus
Mar 18, 2010JSESSIONID Cookie failover
Hello,
I was wondering if anyone has some examples of a i-rule to persist on primary and secondary nodes for Weblogic v10. I seen some older posts on doing this but they where using jsession uri, We use JSESSION cookies.
Thanks,
36 Replies
- Danardono1
Nimbostratus
Hi Hoolio,
I tested on production enviroment, but some user experience problem. There are log on weblogic that show , the traffic send to wrong server. FYI, we use TMOS 10.1 HF2
<[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1283817499961> CMSWeb1, a server that is neither the primary (6213997039278044148S:192.168.68.65:[8003,8003,-1,-1,-1,-1,-1]:CMSWebDomain:CMSWeb5) nor the secondary (4020668254789391387S:192.168.68.66:[8003,8003,-1,-1,-1,-1,-1]:CMSWebDomain:CMSWeb6). The request URL was: https://xxx.yyy.co.id:443/corp/common/login.do>
and on F5 log, we found a strange log
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: POST to xxx.yyy/corp/common/login.do?action=login cookie: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5!865954505!-983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Scanning cookie: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5!865954505!-983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Scanned: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5 865954505 -983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Cookie: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5!865954505!-983302054 pri: 865954505; sec: -983302054; pri UIE: pool_cms 10.44.133.21 9003; sec UIE: pool_cms 10.44.133.22 9004
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Using primary UIE persistence
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Adding: persist add uie 865954505 3600
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic : 124.195.16.245:2875: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054 set by 10.44.133.21:9001, UIE: pool_cms 10.44.133.21 9003
There is different server information on setby and UIE on HTTP RESPONSE (set by 10.44.133.21:9001, UIE: pool_cms 10.44.133.21 9003).
For normal condition, the log show like this
-------------------------------------------
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: GET to xxx.yyy/corp/common/login.do?action=callMainPopUpBNI cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Scanning cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Scanned: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX 865954505 -983302054
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054 pri: 865954505; sec: -983302054; pri UIE: pool_cms 10.44.133.21 9003; sec UIE: pool_cms 10.44.133.22 9004
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Using primary UIE persistence
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Selected server pool_cms 10.44.133.21 9003
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Connected server 10.44.133.21:9003
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!-758494554!769404233
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Adding: persist add uie -758494554 3600
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic : 124.195.16.245:60486: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!-758494554!769404233 set by 10.44.133.21:9003, UIE: pool_cms 10.44.133.21 9003
Thanks n Regards
-Dafa13 - Reall good info, thanks guys!
- hoolio
Cirrostratus
Hi Dafa13,
Is it possible that the connection to the primary server failed for that specific request? Do you have the LB_FAILED event logging uncommented? If not, could you enable it? Do you see any errors on the primary web app from that time?
Also, the forums remove any strings which look like HTML tags. If you post logs again, can you remove the angle brackets from the iRule event names?
Thanks, Aaron - Danardono1
Nimbostratus
Hi Hoolio,
I repost the log. On error condition, i also do not find LB_SELECTED or SERVER_CONNECTED log.
error condition
--------------------
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:2875: POST to xxx.yyy.co.id/corp/common/login.do?action=login cookie: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5!865954505!-983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:2875: Scanning cookie: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5!865954505!-983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:2875: Scanned: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5 865954505 -983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:2875: Cookie: dTctMFQbQTBvLLvD6L1QTrXW5L1Lh3p39740NPNQVrdVyJBTvyY5!865954505!-983302054 pri: 865954505; sec: -983302054; pri UIE: pool_cms 10.44.133.21 9003; sec UIE: pool_cms 10.44.133.22 9004
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:2875: Using primary UIE persistence
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_RESPONSE: 124.195.16.245:2875: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_RESPONSE: 124.195.16.245:2875: Adding: persist add uie 865954505 3600
Sep 7 07:27:16 local/tmm info tmm[5149]: Rule irule_weblogic HTTP_RESPONSE: 124.195.16.245:2875: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054 set by 10.44.133.21:9001, UIE: pool_cms 10.44.133.21 9003
normal condition
-----------------
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:60486: GET to xxx.yyy.co.id/corp/common/login.do?action=callMainPopUpBNI cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:60486: Scanning cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:60486: Scanned: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX 865954505 -983302054
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:60486: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!865954505!-983302054 pri: 865954505; sec: -983302054; pri UIE: pool_cms 10.44.133.21 9003; sec UIE: pool_cms 10.44.133.22 9004
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_REQUEST: 124.195.16.245:60486: Using primary UIE persistence
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic LB_SELECTED: 124.195.16.245:60486: Selected server pool_cms 10.44.133.21 9003
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic SERVER_CONNECTED: 124.195.16.245:60486: Connected server 10.44.133.21:9003
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_RESPONSE: 124.195.16.245:60486: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!-758494554!769404233
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_RESPONSE: 124.195.16.245:60486: Adding: persist add uie -758494554 3600
Sep 7 07:27:17 local/tmm1 info tmm1[5160]: Rule irule_weblogic HTTP_RESPONSE: 124.195.16.245:60486: Cookie: PVs8MFQHvT7MrVyyS1ZxZG1hTRLXr9Rn7hd8tJ36vNQvhPWmJLxX!-758494554!769404233 set by 10.44.133.21:9003, UIE: pool_cms 10.44.133.21 9003 - Danardono1
Nimbostratus
On the log above, the LB_FAILED event logging is uncommented, and there are no any error on primary web app. For small user on testing enviroment , the irule working good, but when we do on production enviroment, we found the error. - hoolio
Cirrostratus
It sounds like the iRule might be working correctly, but an existing serverside connection is being re-used. Do you have a OneConnect profile associated with the VS? Are the serverside connections being SNAT'd? If you don't have OneConnect enabled, can you create a custom OneConnect profile and add it to the VS? If you're using SNAT, then leave the source mask set to 0.0.0.0 to reuse the serverside connections for all clients. If you don't use SNAT, then set the source mask to 255.255.255.255.
For details on OneConnect, you can check the wiki page:
OneConnect
http://devcentral.f5.com/wiki/default.aspx/AdvDesignConfig/oneconnect.html
Aaron - Danardono1
Nimbostratus
Hi Hoolio, i will test it.
I have question about oneconnect, is there any relation between oneconnect with persistence? and why we need oneconnect for this case.
Thank you
Dafa13 - hoolio
Cirrostratus
Hi Dafa13,
Without OneConnect enabled, LTM will open a serverside connection when a new clientside TCP connection has been established. If multiple clients connect over the same clientside TCP connection, those clients will be sent to the same serverside connection even if the persistence info each client presents points to a different pool member. When you enable OneConnect, among other things, LTM will parse each HTTP request to see if a new serverside connection is required to persist the request to a different server regardless of the current serverside connection open.
This is described more completely in the links on the OneConnect wiki page: http://devcentral.f5.com/wiki/default.aspx/AdvDesignConfig/oneconnect.html
Aaron - Danardono1
Nimbostratus
Hi hoolio,
thank you for the oneconnect information.
We have activated the oneconnect, we use SNAT configuration and use 0.0.0.0/0 on one connect source address profile, but we still experience the same problem.
Do you have information about F5 TMOS version that use this irule on production? maybe we need to downgrade the TMOS.
Thanks n Regards - hoolio
Cirrostratus
Can you post anonymized copies of the current VS config, iRule and /var/log/ltm logs showing a success and failure?
Thanks, Aaron
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
