LVS负载均衡几种模式实战部署
)
一、部署所需要配置的服务器
主机名称 | 操作系统 | IP地址 | 安装包 |
---|---|---|---|
负载调度器 | CentOS7.6 | 内网:192.168.40.80、外网:12.0.0.1 | ipvsadm |
NFS服务器 | CentOS7.6 | 192.168.40.50 | rpcbind、nfs-utils |
node1 | CentOS7.6 | 192.168.40.60 | rpcbind、nfs-utils、httpd |
node2 | CentOS7.6 | 192.168.40.61 | rpcbind、nfs-utils、httpd |
客户端 | CentOS7.6 | 12.0.0.15 | / |
客户端 | Windows10 | 12.0.0.66 | / |
二、LVS负载均衡NAT模式
1.部署NFS服务器
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
yum install nfs-utils rpcbind -y
systemctl start rpcbind.service
systemctl start nfs.service
systemctl enable nfs.service
systemctl enable rpcbind.service
mkdir /opt/rain /opt/drop
chmod 777 /opt/rain /opt/drop
vim /etc/exports
/usr/share *(ro,sync)
/opt/rain 192.168.40.0/24(rw,sync)
/opt/hua 192.168.40.0/24(rw,sync)
---发布共享---
exportfs -rv
echo 'this is rain55555 web!' > /opt/rain/index.html
echo 'this is drop56666 web!'