Skip to main content

Posts

Showing posts with the label jvmRoute

Tomcat Clustering : Session Affinity

Session affinity/Sticky Session   Session affinity overrides the load-balancing algorithm by directing all requests in a session to a specific tomcat server. So when we setup the session affinity our problem will solved. But how to setup because session values are random value. We need to generate the session value some how identify the which tomcat generate response. Step 1: Tomcat configuration file (conf/server.xml) contain  <Engine> tag have jvmRoute property for this purpose. So edit the config file and update the <Engine > tag like this <Engine name="Catalina" defaultHost="localhost“ jvmRoute=“tomcat1” > Here tomcat1 is worker name of this tomcat. check the workers.properties file in last post .  Change this line to all tomcat instances  conf/server.xml file and change the jvmRoute value according to workers name and restart the tomcat instances. Now all tomcat generate the session-id pattern...