Configure Tomcat cluster

xiaoxiao2021-03-06  41

0. Summary 0.1 Target configuration of Tomcat clusters that scalable, high available, load balancing and error recovery

0.2 License Agreement GNU Free Documentation license allows any reprinted, but please keep this document if there is a modification, please notify the author

1. Download 1.1 Tomcat1.2 Tomcat Session Replication Library

2. Installation 2.1 first Tomcat

$ tar vfxz jakarta-tomcat-4.1.27.tar.gz $ cp -r jakarta-tomcat-4.1.27 /www/server/tomcat12.2 Second Tomcat # temporarily not install, wait for a Tomcat, Direct copy get a copy, modify it on the basis of a copy

2.3 JK2 # Please refer to "WEB Server" under Linux Support JSP / PHP.

3. Configuring 3.1 Apache JK2 Profile Workers2.properties # This is the Apache's JK2 profile, located in the confed directory in the Apache installation directory, if there is no such file, the new # content is as follows

$ vi workers2.properties [shm] file = $ {serverroot} /logs/shm.file size = 1048576 # first tomcat [channel: Tomcat1] port = 11009 host = 127.0.0.1 [AJP13: Tomcat1] channel = channel1] channel = channel1 Socket: Tomcat1 # Second Tomcat [Channel.socket: Tomcat2] port = 12009 host = 127.0.0.1 [AJP13: Tomcat2] channel = channel2 # loading balance [lb: lb1] worker = ajp13: tomcat1 worker = ajp13: Tomcat2 # uri mapping [uri: / *. jsp] group = lb: lb: lb13.2 The first Tomcat jk2 configuration file jk2.properties # This is the first Tomcat's JK2 configuration file, located in the first Tomcat installation directory CONF directory # 找 nnSocket.port = 8009 # Cancel the comment and modify

ChannelSocket.port = 110093.3 The first Tomcat configuration file server.xml # This is the first Tomcat configuration file, located in the first Tomcat installation directory in the confed directory # found

# Modified to

# Open JK2 AJP Connector, close other Connector (that is, remove other Connector delete or comment) # 修 j j j j 11 11 11 11 11 11 11 11 11 The latter Connector may like the following

# WebApp supported by the cluster Context, add the following manager 3.4 The first Tomcat startup script catalina.sh # This is the first Tomcat startup script, located in the bin directory in the first Tomcat installation directory # Add the launched environment variables as follows

Java_home = / usr / java / jdk catalina_home = / www / server / tomcat1 # The java_home pointing to the system actually installs the JDK path # The Catalina_home here point to the first Tomcat installation path

3.5 Copy the first Tomcat to get the second Tomcat

CP -R Tomcat1 Tomcat23.6 Second Tomcat JK2 Profile JK2.Properties # Reference 3.2 # Modify ChannelSocket.port for ChannelSocket.port = 12009 # Note and the First Tomcat Differences

3.7 Second Tomcat configuration file server.xml # Reference 3.3 # Modify Close port is

# Modify the port of JK2 AJP Connector to 12009, the modified Connector may like the following

# Note and the first Tomcat difference

3.8 Second Tomcat startup script Catalina.sh # Reference 3.4 # Add startup environment variables as follows

Java_Home = / usr / java / jdk catalina_home = / www / server / tomcat2 # The java_home pointing to the system actually installs JDK Path # The Catalina_home point to the second Tomcat installation path # Note and the first Tomcat difference

4. Complete 4.1 RACHE

$ apache / bin / apachectl graceful4.2 launched the first Tomcat

$ TOMCAT1 / BIN / CATALINA.SH Start 4.3 Launches the second Tomcat

$ Tomcat2 / Bin / Catalina.sh Start5. Reference http://www-900.ibm.com/developerWorks/cn/java/l-jetspeed/http://www.filip.net/tomcat/

转载请注明原文地址:https://www.9cbs.com/read-77679.html

New Post(0)