0 Replies Latest reply on Oct 21, 2013 5:21 AM by weinanli

    How to configure mod_jk session stickyness in domain mode

    weinanli

      I'm trying to configure session stickyness in mod_jk, and in mod_jk document it says:

       

      If you want to use session stickiness, you must set different jvmRoute attributes in the Engine element in Tomcat's server.xml. Furthermore the names of the workers which are managed by the balancer have to be equal to the jvmRoute of the Tomcat instance they connect with.

       

      So I've searched the AS7 document and found the method to set jvmRoute is to put 'instance-id' in web subsystem: https://issues.jboss.org/browse/AS7-1365

       

      But in domain mode the config is centralized in 'domain.xml' so how can I set different 'instance-id's to different AS7 servers? Because besides the domain controller, other AS7 servers only have 'host.xml'. Does that mean they are reusing the 'instance-id' configured in 'domain.xml'?

       

      btw, I saw in JK status page the sticky  session is enabled by default:

       

      SafariScreenSnapz139.png

       

      As the snapshot shown above, I have two AS7 worker nodes in cluster, and they are running in domain mode. Master is the domain controller. I didn't configure stickness in workers.properties and I haven't put 'instance-id' element in 'domain.xml'. Here are my configs:

       

      worker.list=lb,jk-status
      
      worker.master.type=ajp13
      worker.master.host=10.0.1.13
      worker.master.port=8259
      
      worker.slave.type=ajp13
      worker.slave.host=10.0.1.19
      worker.slave.port=8259
      
      worker.lb.type=lb
      worker.lb.balance_workers=master,slave
      
      worker.jk-status.type=status
      
      

       

      In my 'host.xml" on both AS7 servers, the server name are 'master' and 'slave'. Here is the packet analysis:

       

      X11ScreenSnapz013.png

       

      So I guess in domain mode, the host name is used as the 'jvmRoute' in AJP connector. Is that correct? And the stickyness session is enabled by JK by default? The JK version I'm using is 'tomcat-connectors-1.2.37-src'.