Configure Tomcat cluster

zhaozj2021-02-16  47

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

0.3 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 / tomcat1 2.2 second tomcat # temporarily not install, etc. After configuring a Tomcat, Copy the copy and 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: lb1 3.2 First Tomcat JK2 Profile JK2.Properties # This is the first Tomcat's JK2 configuration file, located in the first Tomcat installation directory CONF directory # 找 n n elT.port = 8009 # Cancel the comment and modify

ChannelSocket.port = 11009 3.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

# # # # # J j j a a a a a)))))))) a a a a a a a a a a a a a a a) a a) 象 子 样 样 子 象WebApp's Context, add the following Manager 3.4 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 startup environment variables as follows

Java_Home = / usr / java / jdk catalina_home = / www / server / tomcat1 # The java_home pointing to the system actually installs JDK path # The Catalina_Home here point to the first Tomcat installation path 3.5 Copy the first Tomcat to get the first Two Tomcatcp -r Tomcat1 Tomcat2 3.6 Second Tomcat JK2 Profile JK2.Properties # Reference 3.2 # Modify ChannelSocket.Port

Channelsocket.port = 12009 # Note and the first Tomcat Differences 3.7 Second Tomcat configuration file server.xml # Reference 3.3 # Modify the Close Port is

# Modify the port of JK2 AJP Connector 12009, the modified Connector may like the following # 注意 注意 第一 第一 差 差 差 差 3 3 3 3 3 脚 本 本 本 启 本 本 下 本

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 graceful 4.2 Launches the first Tomcat

$ Tomcat1 / Bin / Catalina.sh Start 4.3 Launches the second Tomcat

$ Tomcat2 / bin / catalina.sh start

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

New Post(0)