-
Apache2.4配置集群,做网络负载均衡(很靠谱
https://blog.csdn.net/mimi00x/article/details/81350222 -
httpd服务的配置及应用
https://www.jianshu.com/p/687b915766b6 -
Apache httpd.conf配置详解
https://www.cnblogs.com/langren1992/p/5160912.html -
keepalived+LVS
http://blog.51cto.com/11233559/2103652 -
我的理解:
- 通过流量分发模块实现负载均衡,让此服务器成为1个调度器,分发流量到2个真实服务器上。
- 根据第一个链接编辑配置文件:
//配置好110、111两台主机上的httpd服务
vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
ServerAdmin localhost
DocumentRoot "D:\www\web2"
<Directory "D:\www\web2">
Options FollowSymLinks
AllowOverride All
//注意Apache2.4必须加,否则出现403错误
Require all granted
</Directory>
</VirtualHost>
//在另一台httpd上创建并加入如下内容
vim /etc/httpd/conf.d/vhost.conf
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ProxyRequests off
proxyPass / balancer://myBlancer/
proxyPass / balancer://myBlancer/ stickysession=sessionid nofailover=On
<Proxy balancer://myBlancer/>
BalancerMember http://192.168.233.110:80/ loadfactor=3
BalancerMember http://192.168.233.111:80/ loadfactor=6
ProxySet lbmethod=bytraffic
</Proxy>
</VirtualHost>
网友评论