Testing failover in cluster environments | weblogic
To test session replication and failover in a clustered environment you can follow below easy steps to confirm cluster works.
Env. Assumptions:
We have deployed application on a cluster containing 4 managed servers and the environment is like below :
WLS : 10.3.4
Apache or Sun One Webserver or Oracle Http Server
F5 Load balancer.
The request flow is like below :
F5 LOAD BALANCER >> 2 Instances of Sun One Webserver >> 4 Managed servers ( on two separate physical boxes )
Now to test the session replication and Failover functionality
Follow below steps:
1) First accesses the application and then find out on which server the request has reached to. ( say MS2 )
2) Then bring down MS2 and then try to access the application from the same browser as a same user (i.e jsession id remains the same)
3) The application should work perfectly fine. Check the managed server that this request has reached to. ( say MS3)
4) Now bring down MS3 and then try to access the application from the same browser and as the same user.
5) The application should work fine with out a SESSION TIMEOUT or relogin to application on the same browser.
If you find any issues during test, enable debug in the proxy logs, and check the behavior found :
When the session was successfully replicated and failover was successful the below should be observed in the WLS proxy log :
PLUGIN should successfully determine that the primary is down, and should print the message.
Then the headers from Client to WLS should go with JSessionId!PrimaryJVMId!SecondaryJVMid(E.g: JSESSIONID=5vxnN6WQVd76gi2lRxTdK2xJLS2hnhf21lfMbvWZWP1pb7M2TS61c!-83434323!-1345687328) and headers returned from weblogic to Client should be SameJSessionId!SecondaryJvmId!NewJVMID(new secondary)(E.g: 5vxnN6WQVd76gi2lRxTdK2xJLS2hnhf21lfMbvWZWP1pb7M2TS61c!-1345687328!738324015)
One more thing to see is parsing headers should return 200 OK not any other code.
Example log:
URL::parseHeaders: CompleteStatusLine set to http://HTTP/1.1 200 OK
Check below log which says session replication and fail-over is working perfectly fine :
Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:cookie=JSESSIONID=5vxnN6WQVd76gi2lRxTdK2xJLS2hnhf21lfMbvWZWP1pb7M2TS61c!-83434323!-1345687328 Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:Proxy-Path-Translated=[/sites/sepic/site/live/html/Gmae/app] Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:Proxy-Path-Translated-Base=[/sites/sepic/site/live/html] Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:WL-Proxy-Client-IP=http://71.211.166.9 Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:WL-Proxy-SSL=false Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:Proxy-Client-IP=http://71.211.166.9 Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:X-Forwarded-For=http://71.211.166.9 Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:Connection=Keep-Alive Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:X-WebLogic-KeepAliveSecs=30 Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:X-WebLogic-Request-ClusterInfo=true Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs to WLS:x-weblogic-cluster-hash=d48hwCCkwo78M8QPd1mjpM+w9KQ Thu Jan 12 10:47:02 2012 <85711308235656566> URL::parseHeaders: CompleteStatusLine set to http://HTTP/1.1 200 OK Thu Jan 12 10:47:02 2012 <85711308235656566> URL::parseHeaders: StatusLine set to 200 OK Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Cache-Control=no-cache, no-store, must-revalidate Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Date=Thu, 12 Jan 2012 14:47:02 GMT Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Transfer-Encoding=chunked Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Content-Type=text/html;charset=UTF-8 Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Expires=Thu, 01 Jan 1970 00:00:00 GMT Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Content-Encoding=gzip Thu Jan 12 10:47:02 2012 <85711308235656566> Hdrs from WLS:Set-Cookie=JSESSIONID=5vxnN6WQVd76gi2lRxTdK2xJLS2hnhf21lfMbvWZWP1pb7M2TS61c!-1345687328!738324015; path=/
If you see above proxy log pattern in all your tests to check fail over and session replication and do not see any other errors in WLS logs during this time which relates to fail-over then you can tell fail-over and session replication is working fine and verified.
In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.
Q)
As Mentioned :First accesses the application and then find out on which server the request has reached to.
How to check the server which got accessed??
you can check it via webserver access.log that which server the request is hitting..