实战day03(六)----nginx实现负载均衡
接上一篇
sina和sohu不可能只有一台服务器。最起码有2台。
比如,sina,8080和8082同时提供同样的服务(集群)。这就需要负载均衡。
sina再来一个tomcat
[[email protected] local]# vim tomcat-sina2/conf/server.xml
[[email protected] local]# vim tomcat-sina2/webapps/ROOT/index.jsp
[[email protected] local]# tomcat-sina2/bin/startup.sh
[[email protected]CentOS nginx]# sbin/nginx -s reload
现在再访问www.sina.com.cn就轮流访问这两个节点了
设置权重,权重越大,访问的就越多