1.需要工具,nginx 服务器,大于两台tomcat服务器
2.配置nginx.config
#这里的域名要和下面proxy_pass的一样
upstream fengzp.com {
server 192.168.110.201:80 weight=1;
server 192.168.110.202:80 weight=2;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
# root html;
# index index.html index.htm;
proxy_pass http://fengzp.com;
proxy_redirect default;
}
3.分别启动nginx,tomcat服务器
4.测试成功