Apache-based Tomcat load balancing and cluster configuration session sharing

Source: Internet
Author: User

Follow the above topic and then continue to improve. Why didn't you get the last article? The reason is very simple too long articles do not love to see! Just like someone wrote thousands of ways, not forcing people who love to watch, anyway I don't look.

During the time I did not have a configuration success, from the beginning of the failure to say,

1. Preparing the JAR Package

Note: Different versions of Tomcat (TOMCAT6,TOMCAT7) require packages that need to be downloaded for the Tomcat version.

This is the latest stable version in use 1.6

First I went to the official website: http://code.google.com/p/memcached-session-manager/downloaded the latest jar

Because the company's network is a lot of Web sites you understand, not to go, and later from Https://github.com/magro/memcached-session-manager download other jar package, in short find a long time to get together

2. Configuration

1. Copy all of the above mentioned packages to Tomcat Lib (two Tomcat required)

2. Modify the Context.xml file in the Conf directory of each Tomcat by adding any of the following code:

<manager classname="De.javakaffee.web.msm.MemcachedBackupSessionManager"Memcachednodes="n1:localhost:11211"Sticky="false"Sessionbackupasync="false"Lockingmode="uripattern:/path1|/path2"Requesturiignorepattern=".*\. (ICO|PNG|GIF|JPG|CSS|JS) $"Transcoderfactoryclass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"/>

There are several methods of serialization,

    • Javolution Serialization Tomcat Configuration
    • XStream Serialization Tomcat Configuration
    • Flexjson Serialization Tomcat Configuration
    • Kryo Serialization Tomcat Configuration

It is said that Kryo serialization efficiency is relatively fast, that also choose what. In fact, the above-mentioned jar package contains these kinds, actually put in Lib under the not so many packages. In the end I put nine bags, and so on.

Configured to start Tomcat, and then error, as expected, error meaning lack of class de.javakaffee.kryoserializers.LocaleSerializer,

Kryo-serializers, small problems, missing on the Find Bai, found that there is no class, decisive upgrade to find Kryo-serializers-0.11.jar.

Start test Error againjava.lang.NoSuchMethodError: net.spy.memcached.MemcachedClient.set(Ljava/lang/String;ILjava/lang/Object;)Lnet/spy/memcached/internal/OperationFuture;。解决方法spymemcached-2.7.jar升级到spymemcached-2.8.4.jar.

There's information in the retry boot.

Successfully completed. Browser test too heavy results inconsistent ah, I just xxx.

From the above test results, give me a hint of decisive replacement Tomcat unified with 6.0.18 version, although the beginning of the 6.0.37 is also TOMCAT6, but the test is not successful, there seems to be a difference between the specific reasons there is no deep exploration.

Finally, put all 9 jar packages

In short, the version is always critical.

Several reference links included

Http://www.cnblogs.com/interdrp/p/4096466.html

http://www.iteye.com/topic/1125301

Apache-based Tomcat load balancing and cluster configuration session sharing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.