Tomcat cluster configuration in windows

Source: Internet
Author: User

1. Add the following content in httpd configuration.

# Example:
LoadModule jk_module modules/mod_jk.so
#
JkWorkersFile conf/workers. properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount/jsp-examples/*. * machine

 

 

2. Add the following content to the workers. properties file:

Worker. list = machine

Worker. tomcat1.port = 8009
Worker. tomcat1.host = 192.168.0.21
Worker. tomcat1.type = ajp13
Worker. tomcat1.lbfactor = 10

Worker. tomcat2.port = 8010
Worker. tomcat2.host = 192.168.0.21
Worker. tomcat2.type = ajp13
Worker. tomcat2.lbfactor = 10

Worker. tomcat3.port = 8011
Worker. tomcat3.host = 192.168.0.21
Worker. tomcat3.type = ajp13
Worker. tomcat3.lbfactor = 10

Worker. machine. type = lb
Worker. machine. balance_workers = worker at1, tomcat2, tomcat3

 

 

3. Add the following content to the tomcat server. xml file:

1. Modify the Server port. <Server port = "8005" shutdown = "SHUTDOWN">

2. comment out the default connection port (<Connector port = "8080 ")

<! --> Define a non-ssl http/1.1 Connector on port 8080
<Connector port = "8080" maxHttpHeaderSize = "8192"
MaxThreads = "150" minSpareThreads = "25" maxSpareThreads = "75"
EnableLookups = "false" redirectPort = "8443" acceptCount = "100"
ConnectionTimeout = "20000" disableUploadTimeout = "true"/>
3. modify jk port (to work with workers. in properties) <Connector port = "8009" enableLookups = "false" redirectPort = "8443" protocol = "AJP/1.3"/>

4. Add jvmRoute = "cmdat1" (to correspond to workers. properties)

<Engine name = "Standalone" defaultHost = "localhost" jvmRoute = "tomcat1">

5. Comment <Engine name = "Catalina"

<! --> Define the top level container in our container hierarchy
<Engine name = "Catalina" defaultHost = "localhost">

 

 

4. Modify

Set SERVICE_NAME = Tomcat52
Set PR_DISPLAYNAME = Apache Tomcat (Tomcat52)

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.