Basically, you start a tomcat on only one computer, and booting multiple Tomcat will prompt for errors and other related failures. And if debugging load balancing and clustering, you need to open multiple Tomcat on a computer, then how to open it?
Method/Step
- The first thing to know is that we need to configure environment variables when we do not start Tomcat through other tools such as Eclipse and manually start Tomcat. When we start Tomcat, we need to read the relevant configuration in the environment variable to run. In other words, if I have more than one tomcat, it starts with Tomcat in the environment variable. This will cause the boot to fail because of a port conflict.
- If we want to start multiple tomcat, we need to do it in the environment variable. Tomcat environment variable is catalina_home, if we want to configure multiple, you can configure environment variables such as CATALINA_HOME1,CATALINA_HOME2, variable name casually named, the value is Tomcat directory.
- If we want to start two Tomcat and copy Tomcat to two, create an environment variable catalina_home1,catalina_home2 of two tomcat directories respectively.
- We also need to modify the Catalina.bat and Startup.bat two files in the bin directory of Tomcat. Replace the catalina_home in two files with the environment variables we set, such as Catalina_home1 or catalina_home2
- 5
OK, after configuration, we just need to change the Tomcat port to be different, we can realize the function of multi-open, as to how to modify the Tomcat port, you can see the resources.
(go) How to turn on multiple tomcat on a single computer and configure which specific Tomcat the system recognizes