In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use Nginx+Tomcat+Keepalived to build a high-performance and high-availability load balancing cluster". In daily operations, I believe many people have doubts about how to use Nginx+Tomcat+Keepalived to build a high-performance and high-availability load balancing cluster. I have consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use Nginx+Tomcat+Keepalived to build a high-performance high-availability load balancing cluster". Next, please follow the editor to study!
Before we start building, let's take a look at some of the more important concepts involved.
I. reverse proxy
1.1 what is a reverse proxy
Reverse proxy (Reverse Proxy) means that the proxy server accepts the connection request on the internet, then forwards the request to the server on the internal network, and returns the result obtained from the server to the client requesting the connection on the internet. At this time, the proxy server behaves as a reverse proxy server.
To put it simply, the forward proxy is for your client, as shown below:
The reverse proxy is for the server, as shown below:
1.2 configuration of reverse proxy
Nginx is used here as the reverse proxy server.
(1) modify nginx configuration file on nginx host
Upstream tomcat-portal {server xxx (ip of the server your tomcat installed): 8080;} server {listen 80; server_name xxxx (domain name accessed by your project); location / {proxy_pass http://tomcat-portal; index index.html;}
Second, load balancing
2.1 what is load balancing
Load balancing is based on the existing network structure, which provides a cheap, effective and transparent way to expand the bandwidth of network devices and servers, increase throughput, enhance network data processing capacity, and improve network flexibility and availability. The English name is Load Balance, which means to distribute the execution to multiple operation units, such as Web server, FTP server, enterprise critical application server and other critical task servers, so as to complete the task together.
Load balancer implemented with nginx+tomcat. Nginx is used as the load balancer. All requests initiated by web are forwarded to Nginx,Nginx and then forwarded to Tomcat server, as shown below:
2.2 configuration of load balancing
Install Tomcat on each of the three servers and point to the ip+Tomcat port of each of the three servers in the configuration file of Nginx.
Modify the Nginx configuration file:
Upstream tomcat-portal {server Tomcat1 ip:8080; server Tomcat2's ip:8080; server Tomcat3 ip:8080;} server {listen 80; server_name xxxx (the domain name accessed by your project); location / {proxy_pass http://tomcat-portal; index index.html;}}
Through the above configuration, when accessing the project, the three servers will share the pressure of system access.
At this point, the study on "how to use Nginx+Tomcat+Keepalived to build a high-performance and high-availability load balancing cluster" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Kubernetes AloneSingle Tenant IngressRolling POD UpgradesPOD Scaling and HAStateful Sets of PODSMult
© 2024 shulou.com SLNews company. All rights reserved.