Session replication of Apache + Tomcat clusters and TomcatCluster

Source: Internet
Author: User
Session replication of Apache + Tomcat clusters and TomcatCluster-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Apache: 10.1.2.3
Tomcat server1: 10.1.2.2
Worker-worker AT1 ------ worker1
─ ── Tomcat2 ------ worker2
─ ── Tomcat3 ------ worker3

Tomcat server1: 10.1.2.8
─ ── Tomcat4 ------ worker4
─ ── Tomcat5 ------ worker5
─ ── Tomcat6 ------ worker6

Apache:
Apache/conf/extra: httpd-vhosts.conf, as shown below

ServerAdmin xxyujian@gmail.com
ServerName xxx.xxx.com
ServerAlias xxx.xxx.com
ProxyRequests Off

BalancerMember ajp: // 10.1.2.2: 8009 loadfactor = 1 route = worker1
BalancerMember ajp: // 10.1.2.2: 8109 loadfactor = 1 route = worker2
BalancerMember ajp: // 10.1.2.2: 8209 loadfactor = 1 route = worker3
BalancerMember ajp: // 10.1.2.8: 8009 loadfactor = 1 route = worker4
BalancerMember ajp: // 10.1.2.8: 8109 loadfactor = 1 route = worker5
BalancerMember ajp: // 10.1.2.8: 8209 loadfactor = 1 route = worker6

ProxyPass/balancer: // cluster/lbmethod = byrequests stickysession = JSESSIONID nofailover = Off timeout = 5 maxattempts = 3
ProxyPassReverse/balancer: // cluster/
ErrorLog "logs/study.com-error_log"
CustomLog "logs/study.com-access_log" common

Tomcat: I originally wanted to replicate sessions between Tomcat 1 and 4, Tomcat 2 and 5, Tomcat 3 and 6 to form three groups of sub-clusters for session replication, but the sessions between servers could not be copied, later, I switched to two tomcat servers on the same server, for example, tomcat1 and 2. In this way, Session replication can be performed, that is, I access the program. Currently I use tomcat1, And I manually stop tomcat1, refresh the page, or the session that jumps to another tomcat1 is copied to tomcat2. I do not know whether Session replication can be performed between tomcat on the two servers. How can I set the Server. xml configuration of tomcat:
# Ports on the same server are different
# The AJP ports on the same server are different
# JvmRoute: unique value for each tomcat

ChannelSendOptions = "8">
ExpireSessionsOnShutdown = "false"
NotifyListenersOnReplication = "true"
MapSendOptions = "8"/>



Address = "228.0.0.4" # the same group of tomcat Clusters
Port = "45564" # the same group of tomcat Clusters
Frequency = "500"
DropTime = "3000" type = "codeph" text = "codeph"/>
Address = "auto"
Port = "4000" # different ports on the same machine
AutoBind = "100"
SelectorTimeout = "5000"
MaxThreads = "6"/>









Filter = ""/>


TempDir = "/tmp/war-temp /"
DeployDir = "/tmp/war-deploy /"
WatchDir = "/tmp/war-listen /"
WatchEnabled = "false"/>



Related Article

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.