lvs-server | VIP:10.211.55.99 DIP:10.37.129.99 |
负载均衡器 | 开启路由功能(VIP桥接,DIP仅主机) |
rs01 | RIP:10.37.129.3 | 后端服务器 | 网关指向DIP |
rs02 | RIP: 10.37.129.4 | 后端服务器 | 网关指向DIP |
LVS- server配置
ipvsadm -A -t 10.211.55.99:80 -s wrr ipvsadm -a -t 10.211.55.99:80 -r 10.37.129.3:80 -m -w 1 ipvsadm -a -t 10.211.55.99:80 -r 10.37.129.4:80 -m -w 1
开启路由转发 vim /etc/sysctl.conf net.ipv4.ip_forward=1 sysctl -p 使其生效
RS配置
1.nginx 2.指定网关到DIP