Search code examples
sessionweblogicload-balancing

Primary Secondary server in Weblogic


I have apache proxy web server ahead of 6 weblogic instances which are part of a single cluster.

For a client that hits my application the Apache's access logs shows the below loggin

/Replica/AddServlet;jsessionid=PvqTQtYfKLrzBHtT1dpcJX5WhryRgpTGBvMJ8pLbpJnSDR5p0K65!1647512983!-1661904304!1357731903334 HTTP/1.1" 200 284

How can I determine which out the six is the primary and which is the secondary weblogic server for this client request ?


Solution

  • You have to switch on the Apache DEBUG log, which notes the individual server HASH and maps it to the Managed server.

    Turn on proxy debug by setting Debug=”ALL” in the proxy configuration file.

    Example configuration for Apache plug-in (httpd.conf):

    <Location /mywebapp>
     SetHandlerweblogic-handler
     WebLogicCluster sol1:8001,sol2:8001,sol3:8003
     Debug ALL
     DebugConfigInfo ON
     WLLogFile /tmp/wlproxy.log
     </Location>
    

    You can then see the exact host:port for your primary and secondary for the request.

    Example from http://www.bea-weblogic.com/weblogic-server-support-pattern-common-diagnostic-process-for-proxy-plug-in-problems.html

    Or try this link

    http://www.findsol.com/blog/weblogic-server-support-pattern-common-diagnostic-process-for-proxy-plug-in-problems/

    Mon May 10 13:14:40 2004 getpreferredServersFromCookie: -2032354160!-457294087
    Mon May 10 13:14:40 2004 GET Primary JVMID1: -2032354160
    Mon May 10 13:14:40 2004 GET Secondary JVMID2: -457294087
    Mon May 10 13:14:40 2004 [Found Primary]: 172.18.137.50:38625:65535
    Mon May 10 13:14:40 2004 list[0].jvmid: -2032354160
    Mon May 10 13:14:40 2004 secondary str: -457294087
    Mon May 10 13:14:40 2004 list[1].jvmid: -457294087
    Mon May 10 13:14:40 2004 secondary str: -457294087
    Mon May 10 13:14:40 2004 [Found Secondary]: 172.18.137.54:38625:65535
    Mon May 10 13:14:40 2004 Found 2 servers
    

    Remember each time you restart the weblogic servers, new HASHes are used.