Tomcat sharing session with Memcache is very simple, just test a jar, modify an XML file basically can. But in Windows Daoteng days without fruit, unsuccessful. The online tutorial is basically Linux, which should be used under Linux.
MSM (Memcached-session-manager) supports TOMCAT6 and TOMCAT7 and uses the Value (Tomcat valve) to track request. When request requests arrive, the Tomcat session is updated to memcached at the end of the memcached load Session,request request to support the sticky and Non-sticky modes for session sharing purposes.
Sticky Mode: Tomcat session is the main session, Memcached to prepare the session. When request requests arrive, the session is loaded from memcached to Tomcat (the Tomcat session is taken directly when the Tomcat Jvmroute is changed); When the request ends, the Tomcat The session is updated to memcached to achieve the purpose of master and standby synchronization.
Non-sticky Mode: Tomcat session for relay session, MEMCACHED1 main sessionmemcached 2 for the session. When request requests arrive, the session is loaded from memcached 2 to Tomcat, (when there is no session in the container, the main session is loaded from memcached1 to Tomcat, which is only one memcached node, or When the request ends, the Tomcat session is updated to the master memcached1 and Memcached2, and the Tomcat session is cleared memcached1. To achieve the primary and standby synchronization purposes.
Tomcat session Memcache Sharing