LVS的NAT模式
lvs-nat:本质是多目标IP的DNAT,通 过将请求报文中的目标地址和目标端口修改为某处的RS的RIP和PORT实现转发
- RIP和DIP应在同一个IP网络,且应使用私网地址;RS的网关要指向DIP
- 请求报文和响应报文都必须经由Director转发,Director易于成为系统瓶颈
- 支持端口映射,可修改请求报文的目标PORT
- VS必须是Linux系统,RS可以是任意OS系统
NAT模式 LVS负载均衡部署
NFS服务器配置
systemctl stop firewalld
setenforce 0
yum install nfs-utils rpcbind -y
[root@two ~]# cd /opt
[root@two opt]# mkdir xixi haha
[root@two opt]# echo "xixi" > xixi/index.html
[root@two opt]# echo "haha" > haha/index.html
[root@two opt]# systemctl start rpcbind
[root@two opt]# systemctl start nfs
[root@two opt]# chmod 777 xixi/ haha/
vim /etc/exports
[root@two opt]# systemctl restart nfs
[root@two opt]# exportfs -rv
exporting 192.168.80.0/24:/opt/haha
exporting 192.168.80.0/24:/opt/xixi
节点Web服务器
vim /etc/sysconfig/network-scripts/ifcfg-ens33
第二台节点服务器如上操作
负载调度器
vim /etc/sysctl.conf