- Configure the Nginx scheduler on the 192.168.4.5 host (refer to the nginx configuration file for specific installation steps)
[root@proxy ~]# vim /usr/local/nginx/conf/nginx.conf
http{ upstream toms { server 192.168.2.100:8080 ; server 192.168.2.200:8080; } server { listen 80; server_name localhost; location / { proxy_pass http://toms; } } }
- Configure the Tomcat scheduler on the 192.168.2.100 and 192.168.2.200 hosts The
following takes Web1 as an example:
[root@web1 ~]# yum -y install java-1.8.0-openjdk //Install JDK
[root@web1 ~]# yum -y install java-1.8.0-openjdk-headless //Install JDK
[root@web1 ~]# tar -xzf apache-tomcat-8.0.30.tar.gz
[root@web1 ~]# mv apache-tomcat-8.0 .30 /usr/local/tomcat
3) Start the service
[root@web1 ~]# /usr/local/tomcat/bin/startup.sh - Client Verification
To prevent data caching, you can use the real host's google-chrome to access the proxy server, and enter Ctrl+F5 to refresh the page.
WEB server-Tomcat cluster configuration
Guess you like
Origin blog.csdn.net/weixin_45942735/article/details/104607791
Recommended
Ranking