How to install is not introduced, their own online search.
Configure Nginx. This is then configured on a CAS single sign-on.
[Java] view plain copy upstream 127.0.0.1 {server 127.0.0.1:18080 weight=2; Server 127.0.0.1:28080 weight=2; Server 127.0.0.1:8080 weight=3; }
Weight is the weight value, the larger the number, the greater the chance of being visited.
Modify apache-tomcat-6.0.37\conf and apache-tomcat1\conf and apache-tomcat2\ separately conf under the Context.xml and Server.xml files, added in Server.xml:
<engine name= "Catalina" defaulthost= "localhost" jvmroute= "tomcat6" > Jvmroute are respectively modified to correspond to the names, For example, my apache-tomcat-6.0.37 changes to Tomcat6, and APACHE-TOMCAT1 to tomcat61, and so on.
The purpose of setting Jvmroute is to differentiate between the session from that container.
Increased in Context.xml
[Java] view plain copy <manager classname= "De.javakaffee.web.msm.MemcachedBackupSessionManager" memcache dnodes= "n1:localhost:11211" "requesturiignorepattern=". (PNG|GIF|JPG|CSS|JS) $ "sessionbackupasync=" false "sessionbackuptimeout=" transcoderfactoryclass= " De.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory "copycollectionsforserialization=" false "/>
Remember to add three Tomcat, this is the session of Tomcat to the memcached management. From here you can see the dependent jar package. I uploaded the jar, downloaded it and put it in Tomcat's lib. Download here
The configuration is almost done. Write a test project. Under \webapps build a Nginx file Plus, build a index.jsp inside, the contents are as follows:
[Java] view plain copy <%@ page contenttype= "text/html; CHARSET=GBK "%> <%@ page import=" java.util.* "%>
Start Nginx and memcached, then start three Tomcat, visit http://127.0.0.1/nginx/index.jsp, and constantly refresh the page to see if the SessionID is changing, explain the problem. Load balancing and session sharing were successful.
This is not a screenshot, very simple.