Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to build Apache tomcat Cluster

Shulou Source: shulou.com Published: 2022-06-01 01:31:11 09月22日 Update

This article mainly shows you "how to build an Apache tomcat cluster". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to build an Apache tomcat cluster".

1. Add Include conf/mod_jk.conf after httpd.conf configuration under the conf folder of apache.

2. Create a mod_jk.conf under the conf folder and add the following:

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties

JkMount / * .jsp controller

3. Copy mod_jk.so to the modules folder

4. Create a workers.properties under the conf folder and add the following:

# server

Worker.list=controller

# = tomcat1=

Worker.tomcat1.port=18081

Worker.tomcat1.host=localhost

Worker.tomcat1.type=ajp13

Worker.tomcat1.lbfactor=1

# = tomcat2=

Worker.tomcat2.port=18082

Worker.tomcat2.host=localhost

Worker.tomcat2.type=ajp13

Worker.tomcat2.lbfactor=1

# = tomcat3=

Worker.tomcat3.port=18083

Worker.tomcat3.host=localhost

Worker.tomcat3.type=ajp13

Worker.tomcat3.lbfactor=1

# = controller, load balancer controller =

Worker.controller.type=lb

Worker.controller.balanced_workers=tomcat1,tomcat2,tomcat3

Worker.controller.sticky_session=false

5. Modify the server.xml file of each tomcat to avoid port conflicts in a total of 5 places

These are all the contents of the article "how to build Apache tomcat clusters". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Content files folders ports clusters articles learning help balance commands characters strings attributes controllers easy to understand more servers organization knowledge ribbon Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker vpn Huawei Apple macOS