Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed introduction of Nginx + Tomcat load balancing Cluster

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following will give you a detailed introduction to the Nginx + Tomcat load balancing cluster, hoping to give you some help in practical application. Load balancing involves many things, and there are not many theories. There are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.

Nginx + Tomcat load balancing cluster

--

Experimental environment: host operating system IP address main software Nginx service machine CentOS 7.3x86_64192.168.1.100nginx-1.12.0.tar.gzTomcat service machine 1CentOS 7.3x86x64192.168.1.101① 8080 ① apache-tomcat-8.5.16.tar ② jdk-8u91-linux-x64.tarTomcat service machine 2CentOS 7.3x86x64192.168.1.102 ① apache-tomcat-8.5.16.tar ② jdk-8u91-linux-x64.tar

--

Deploy Tomcat

--

Install JDK to configure the java environment, unzip the jdk to / usr/local, name it java:mv jdk1.8.0_91/ / usr/local/java, and set up the java.sh script under / etc/profile.d/, as follows: export JAVA_HOME=/usr/local/java / / set the Java root directory / / export PATH=$PATH:$JAVA_HOME/bin / / add the bin/ subdirectory under the Java root directory in the PATH environment variable / /

Import the java.sh script into the environment variable:

Source / etc/profile.d/java.sh extract the Tomcat package, move it to / usr/local/, name it tomcat8, start tomcat:mv apache-tomcat-8.5.16/ / usr/local/tomcat7/usr/local/tomca8/bin/startup.sh / / start tomcat///usr/local/tomca8/bin/shutdown.sh / / close tomcat//

Create a site directory and add the test home page:

Mkdir-pv / web/webapp1/ / create web directory / / echo "tomcat 1" > / web/webapp1/index.jsp / / content tomcat 2 on the home page of the second tomcat to distinguish / / edit the tomcat main configuration file, in the

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report