keepalived+lvs+tomcat+nfs架构部署
Posted IT.cat
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了keepalived+lvs+tomcat+nfs架构部署相关的知识,希望对你有一定的参考价值。
目录
二、配置负载调度器lvs(主192.168.59.11,备192.168.59.10)
lvs2(备192.168.59.10)相同配置 (把上面再执行一遍)
配置虚拟VIP地址(vip:192.168.59.100) 两台节点服务器都需要配置
调整内核的arp响应参数以阻止更新VIP的MAC地址,避免发生冲突
修改配置文件keepalived.conf(这步主备lvs操作一致)
一、实验环境准备
DR服务器(LVS):主-192.168.59.11 备-192.168.59.10
tomcat1:192.168.59.12
tomcat2:192.168.59.13
VIP(虚拟回环):192.168.59.100
NFS:192.168.59.14
客户端:192.168.59.90
因为是在内网环境中我们需要配置本地yum仓库,并且关闭防火墙
#!/bin/bash
########关闭防火墙############
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
#######yum仓库#########
mount /dev/cdrom /mnt
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak
touch /etc/yum.repos.d/local.repo
echo "
[local]
name=local
baseurl=file:///mnt
enabled=1
gpgcheck=0
" > /etc/yum.repos.d/local.repo
yum clean all
yum makecache
要在每台主机中都执行一遍
执行效果。
二、配置负载调度器lvs(主192.168.59.11,备192.168.59.10)
安装ipvsadm工具
yum -y install ipvsadm
配置VIP地址(主192.168.59.100)
cd /etc/sysconfig/network-scripts
cp ifcfg-ens33 ifcfg-ens33:0
vim ifcfg-ens33:0
ifup ens33:0 #开启网卡
ifconfig
调整内核(proc)响应参数
对于DR集群模式来说,由于LVS负载调度器和个节点需要共用VIP地址,一个关闭linux内核的重定向参数响应服务器部署一台路由器,那么它不会发送重定向,所以可以关闭该功能
vim /etc/sysctl.conf
net.ipv4.ip_forward = 0 #关闭路由转发功能
net.ipv4.conf.all.send_redirects = 0 #下面都是关闭内核重定向功能
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.ens33.send_redirects = 0
sysctl -p
配置负载分配
ipvsadm -C
ipvsadm -A -t 192.168.59.100:80 -s rr
ipvsadm -a -t 192.168.59.100:80 -r 192.168.59.12:80 -g
ipvsadm -a -t 192.168.59.100:80 -r 192.168.59.13:80 -g
ipvsadm
ipvsadm-save > /etc/sysconfig/ipvsadm
lvs2(备192.168.59.10)相同配置 (把上面再执行一遍)
三、部署共享存储(NFS:192.168.59.14)
安装nfs和rpcbind
yum -y install nfs-utils rpcbind
systemctl start nfs
systemctl start rpcbind
创建共享目录并设置权限
mkdir /opt/db1 /opt/db2
chmod 777 /opt/zb /opt/lc
输入页面内容
echo "i am web1" > /opt/db1/index.html
echo "i am web2" > /opt/db2/index.html
设置共享目录并发布共享
vim /etc/exports
/opt/db1 192.168.59.0/24(rw,sync)
/opt/db2 192.168.59.0/24(rw,sync)
exportfs -rv
备lvs:192.168.59.10相同配置
四、部署节点服务器(tomcat1,tomcat2)
tomcat1:192.168.59.12
tomcat2:192.168.59.13
配置虚拟VIP地址(vip:192.168.59.100) 两台节点服务器都需要配置
此地址仅作为发送web响应数据包的源地址,并不需要监听客户机的访问请求(这里由调度器调度并分发)。因此实验虚接口lo:0来承担VIP地址,并为本机添加一条路由记录,将访问VIP的数据限制在本地,以避免通讯紊乱。
cd /etc/sysconfig/network-scripts/
cp ifcfg-lo ifcfg-lo:0
vim ifcfg-lo:0
启动lo:0网卡,添加VIP本地访问路由
ifup lo:0
ifconfig lo:0
route add -host 192.168.59.100 dev lo:0
设置系统自动识别,并设置执行权限
vim /etc/rc.local
/sbin/route add -host 192.168.59.100 dev lo:0
chmod +x /etc/rc.d/rc.local
调整内核的arp响应参数以阻止更新VIP的MAC地址,避免发生冲突
vim /etc/sysctl.conf
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.arp_ignore = 1
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
sysctl -p
安装tomcat、nfs、rpcbind
tomcat可以使用wget下载(没有网,可以预先下载然后传进去)
yum -y install java
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.65/bin/apache-tomcat-9.0.65.tar.gz
tar -xvf apache-tomcat-9.0.65.tar.gz
mv apache-tomcat-9.0.65 /usr/local/tomcat
#进入配置文件,修改端口为8000
vim /usr/local/tomcat/conf/server.xml
ln -s /usr/local/tomcat/bin/startup.sh /usr/bin/startup.sh
startup.sh #开启tomcat
systemctl start nfs rpcbind #开启服务
访问一下试试就安装完成了
web2和web1一样的配置,但是注意修改IP
web1:挂载共享目录
mount.nfs 192.168.59.14:/opt/db1 /usr/local/tomcat/webapps/ROOT/
df -hT
web2:挂载共享目录
mount.nfs 192.168.59.14:/opt/db2 /usr/local/tomcat/webapps/ROOT/
df -hT
到这里我们小小的测试以下
这样我们lvs+tomcat+nfs就部署完成
五、部署keepalived
这我们选择yum安装就行
yum -y install keepalived
修改配置文件keepalived.conf(这步主备lvs操作一致)
cd /etc/keepalived/
cp keepalived.conf keepalived.conf.bak #备份以下配置文件
vim keepalived.conf
配置主lvs(192.168.59.11)
这里配置的是双主热备,比单配的会更快地切换,还在当中添加了负载均衡策略,配置了后我们其实也不需要再配本地的负载均衡策略了。
! Configuration File for keepalived
global_defs #定义全局参数
notification_email
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1 #邮件服务指向地址
smtp_connect_timeout 30
router_id LVS_1 #指定服务器名,主备服务器不能相同!!!
vrrp_skip_check_adv_addr
#vrrp_strict #一定要注释,取消严格遵守vrrp协议功能,否则VIP无法被连接
vrrp_garp_interval 0
vrrp_gna_interval 0
vrrp_instance VI_1 #定义VRRP热备份实力参数
state MASTER #指定热备状态,主为MASTER,备为BACKUP
interface ens33 #指定承载的VIP地址的物理接口
virtual_router_id 10 #指定虚拟路由器的ID号,每个热备组保持一致
priority 100 #指定优先级,数值越大优先级越高
advert_int 1 #通告间隔秒数(心跳频率)
authentication #定义认证信息,每个热备组保持一致
auth_type PASS #认证类型
auth_pass 1111 #指定验证密码,主备服务器保持一致
virtual_ipaddress
192.168.59.200 #指定集群VIP
vrrp_instance VI_2 #第二个热备组,含义与上方一致
state BACKUP
interface ens33
virtual_router_id 11
priority 50
advert_int 1
authentication
auth_type PASS
auth_pass 1111
virtual_ipaddress
192.168.59.200
virtual_server 192.168.59.100 80 #指定虚拟服务器地址(VIP)、端口、定义虚拟服务器和RIP服务器地址池参数
delay_loop 6 #健康检查的间隔
lb_algo rr #指定调度算法:轮询(rr)
lb_kind DR #指定集群工作模式,直接路由(DR)
persistence_timeout 0 #连接保持时间
protocol TCP #应用服务采用的TCP协议
real_server 192.168.59.12 80 #指定第一个web节点的地址,端口
weight 1 #节点权重
TCP_CHECK #添加健康检查方式
connect_port 80 #添加检查的端口
connect_timeout 3 #添加连接超时时间
nb_get_retry 3 #添加重试次数
delay_beforce_retry 3 #添加重试间隔
real_server 192.168.59.13 80 #指定第二个web节点的地址,端口
weight 1
TCP_CHECK
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_beforce_retry 3
systemctl start keepalived
ip a
配置备lvs(192.168.59.10)
! Configuration File for keepalived
global_defs
notification_email
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_2
vrrp_skip_check_adv_addr
# vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
vrrp_instance VI_1
state BACKUP
interface ens33
virtual_router_id 10
priority 50
advert_int 1
authentication
auth_type PASS
auth_pass 1111
virtual_ipaddress
192.168.59.200
vrrp_instance VI_2
state MASTER
interface ens33
virtual_router_id 11
priority 100
advert_int 1
authentication
auth_type PASS
auth_pass 1111
virtual_ipaddress
192.168.59.200
erver 192.168.59.100 80
delay_loop 6
lb_algo rr
lb_kind DR
persistence_timeout 0
protocol TCP
real_server 192.168.59.12 80
weight 1
TCP_CHECK
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_beforce_retry 3
real_server 192.168.59.13 80
weight 1
TCP_CHECK
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_beforce_retry 3
systemctl start keepalived
ip a
六、最终测试
现在我们是可以正常访问的
我们将主lvs断掉,查看备
再看客户端
还是可以正常访问,到此配置结束
总结
集群满足的三个特点:负载均衡,健康检查,故障切换
对于节点服务器:健康检查如果发现有故障的节点就会将其隔离或者提出集群。待其恢复后在重新加入集群当中。
负载均衡器:健康检查会定时检查主机的状态(包括主机和服务状态)如果主故障就会自动切换到备主机上,待主的恢复重新在让主承载业务请求。
Lvs+keepalived+httpd+NFS搭建高可用
Lvs+keepalived+httpd+NFS搭建高可用
自己捯饬的模型图
NAT模型图
注意事项:RealServer需要把网关指向Director,并且Director要打开转发功能命令如下:
echo "1" > /proc/sys/net/ipv4/ip_foreward
DR模型图
注意事项:需要在RealServer配置如下信息:
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce ifconfig lo:0 $vip netmask 255.255.255.255 broadcast $vip route add -host $vip dev lo:0
Lvs DR 模型搭建,后端Apache使用共享NFS
环境:
搭建NFS共享存储服务,ip
NIP:192.168.220.18
搭建Keepalived,ip
DIP1:192.168.220.28
DIP2:192.168.220.24
VIP:192.168.220.5
搭建RealServer,ip
RIP1:192.168.220.25
RIP2:192.168.220.26
Client Test Host
IP:192.168.11.30
ps:自己三层交换做Vlan
一、NFS搭建步骤
1、查看R1/R2用于跑httpd服务的User
[[email protected] ~]# ps -ef |grep httpd | head -2 root 3318 1 0 14:44 ?00:00:01 /usr/sbin/httpd -DFOREGROUND apache 3319 3318 0 14:44 ?00:00:00 /usr/sbin/httpd -DFOREGROUND #发现apache [[email protected] ~]# id apache #查看apache的UID uid=48(apache) gid=48(apache) groups=48(apache) [[email protected] ~]# id apache #查看apache的UID uid=48(apache) gid=48(apache) groups=48(apache)
2、在NFS-Server上面创建用于共享的文件,并且创建apapche用户UID为48
[[email protected] ~]# clear[[email protected] ~]# mkdir -p /data/site/ [[email protected] ~]# useradd -M -r -s /sbin/nologin -u 48 apache [[email protected] ~]# id apache uid=48(apache) gid=48(apache) groups=48(apache)
3、设定/data/site/www.sunshineboy.com用户与用户组
[[email protected] ~]# chown apache.apache /data/site/ [[email protected] ~]# ls -l /data/site/ total 0drwxr-xr-x 2 apache apache 39 Oct 24 12:22 www.sunshineboy.com
4、安装nfs-utils组件,与启动服务
yum install -y nfs-utlis [[email protected] ~]# systemctl start rpcbind [[email protected] ~]# systemctl start nfs.service [[email protected] ~]# ps -ef | grep nfsroot 3400 2 0 11:30 ?00:00:00 [nfsd4] root 3401 2 0 11:30 ?00:00:00 [nfsd4_callbacks] root 3407 2 0 11:30 ?00:00:00 [nfsd] root 3408 2 0 11:30 ?00:00:00 [nfsd] root 3409 2 0 11:30 ?00:00:00 [nfsd] root 3410 2 0 11:30 ?00:00:00 [nfsd] root 3411 2 0 11:30 ?00:00:00 [nfsd] root 3412 2 0 11:30 ?00:00:00 [nfsd] root 3413 2 0 11:30 ?00:00:00 [nfsd] root 3414 2 0 11:30 ?00:00:00 [nfsd] root 3859 2471 0 15:48 pts/100:00:00 grep --color=auto nfs
5、NFS配置文件设定及exportfst
[[email protected] ~]# cat /etc/exports/data/site/www.sunshineboy.com 192.168.220.0/24(rw,root_squash) [[email protected] ~]# exportfs /data/site/www.sunshineboy.com 192.168.220.0/24
6、清空iptables及关闭SELinux
[[email protected] ~]# iptables -F [[email protected] ~]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] [[email protected] ~]# cat /etc/selinux/config | grep disabled # disabled - No SELinux policy is loaded.SELINUX=disabled [[email protected] ~]# getenforce Disabled
二、Keepalived搭建步骤
1、安装keepalived程序
[[email protected] ~]# yum install -y keepalived #DIP1安装 [[email protected] ~]# yum install -y keepalived #DIP2安装
2、keepalived的D1/D2配置
Director1配置
[[email protected] keepalived]# cat keepalived.conf #查看D1配置 !Configuration File for keepalived global_defs { notification_email { [email protected] } notification_email_from [email protected] smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id LVS_DEVEL vrrp_mcast_group4 224.0.100.18 } vrrp_instance VI_1 { state MASTER interface eno16777728 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.220.5 } } virtual_server 192.168.220.5 80 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 192.168.220.25 80 { weight 1 HTTP_GET { url { path / status_cde 200 } connect_timeout 3 nb_get_retry 3 delay_before_retry 3 } } real_server 192.168.220.26 80 { weight 1 HTTP_GET { url { path / status_cde 200 } connect_timeout 3 nb_get_retry 3 delay_before_retry 3 } } } [[email protected] keepalived]# systemctl start keepalived #DIP1启动服务 [[email protected] keepalived]# ip add sh | grep "192.168.220." #查看,220.5地址有了 inet 192.168.220.24/27 brd 192.168.220.31 scope global dynamic eno16777728 inet 192.168.220.5/32 scope global eno16777728
Director2配置
[[email protected] keepalived]# cat keepalived.conf #查D2看配置 ! Configuration File for keepalived global_defs { notification_email { [email protected] } notification_email_from [email protected] smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id LVS_DEVEL vrrp_mcast_group4 224.0.100.18 } vrrp_instance VI_1 { state BACKUP interface eno16777728 virtual_router_id 51 priority 98 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.220.5 } } virtual_server 192.168.220.5 80 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 192.168.220.25 80 { weight 1 HTTP_GET { url { path / status_cde 200 } connect_timeout 3 nb_get_retry 3 delay_before_retry 3 } } real_server 192.168.220.26 80 { weight 1 HTTP_GET { url { path / status_cde 200 } connect_timeout 3 nb_get_retry 3 delay_before_retry 3 } } } [[email protected] keepalived]# ip add sh | grep "192.168.220" inet 192.168.220.28/27 brd 192.168.220.31 scope global dynamic eno16777728
3、安装ipvsadm查看Lvs调度是否如我们所设定那样
[[email protected] keepalived]# yum install ipvsadm -y #在D2安装ipvsadm [[email protected] keepalived]# yum install ipvsadm -y #在D1安航ipvsadm [[email protected] keepalived]# ipvsadm -Ln #在D1查看Lvs规则 IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 192.168.220.5:80 rr -> 192.168.220.25:80Route 1 0 0 -> 192.168.220.26:80Route 1 0 0 [[email protected] keepalived]# ipvsadm -Ln #在D2查看Lvs规则 IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 192.168.220.5:80 rr -> 192.168.220.25:80Route 1 0 0 -> 192.168.220.26:80Route 1 0 0
三、RealServer步骤搭建
1、编写设定VIP及内核功能参数脚本
[[email protected] ~]# vim skp.sh #在R2上编辑skp.sh脚本添加下面内容 [[email protected] ~]# chmod +x skp.sh #赋予执行权限 [[email protected] ~]# vim skp.sh #在R2上编辑skp.sh脚本添加下面内容 [[email protected] ~]# chmod +x skp.sh #赋予执行权限 #!/bin/bash#vip=192.168.220.5case $1 instart) echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce ifconfig lo:0 $vip netmask 255.255.255.255 broadcast $vip route add -host $vip dev lo:0;; stop) echo 0 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 0 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 0 > /proc/sys/net/ipv4/conf/all/arp_announce echo 0 > /proc/sys/net/ipv4/conf/lo/arp_announce ifconfig lo:0 del $vip ;; esac
2、在RealServer1/RealServer2Z执行该脚本
[[email protected] ~]# sh skp.sh start #执行脚本 [[email protected] ~]# ip add sh | grep "192.168.220" #查看是否成功 inet 192scope global lo:0inet 192.168.220.25/27 brd 192.168.220.31 scope global dynamic eno16777728 [[email protected] ~]# sh skp.sh start #执行脚本 [[email protected] ~]# ip add sh | grep "192.168.220." #查看是否成功inet 192.168.220.5/32 brd 192.168.220.5 scope global lo:0inet 192.168.220.26/27 brd 192.168.220.31 scope global dynamic eno16777728
测试:
[[email protected] ~]# ip add sh | grep "192.168.11." #查看IP地址是否是11.30 inet 192.168.11.17/32 brd 192.168.11.17 scope global lo:0inet 192.168.11.30/24 brd 192.168.11.255 scope global eno16780032 [[email protected] ~]# curl <h1>Test files 25.</h1> [[email protected] ~]# curl <h1>Test files 26.</h1> [[email protected] ~]# curl <h1>Test files 25.</h1> [[email protected] ~]# curl <h1>Test files 26.</h1> [[email protected] ~]# curl [[email protected] ~]# curl [[email protected] ~]# curl [[email protected] ~]# curl http://192.168.220.5/www.sunshineboy.com/index.php | grep "One" #特意把hostname改为不同 % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0<tr><td class="e">System </td><td class="v">Linux Real-Serve-One 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 </td></tr>100 421770 421770 0 758k 0 --:--:-- --:--:-- --:--:-- 762k [[email protected] ~]# curl http://192.168.220.5/www.sunshineboy.com/index.php | grep "Two" #特意把hostname改为不同 % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0<tr><td class="e">System </td><td class="v">Linux Real-Server-Two 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 </td></tr>100 421790 421790 0 1084k 0 --:--:-- --:--:-- --:--:-- 1113k
测试静态动态页面分离
依然使用11.30 IP Client Test
nginx RealServer2配置
server { listen 80; server_name localhost; location / { root /var/www/html; index index.html index.htm; } location ~ .*\.php$ { proxy_pass http://192.168.220.25; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } - nginx RealServer1配置 - server { listen 80; server_name www.855.com; location / { root /var/www/html; index index.html index.htm; } location ~ .*\.php$ { root /var/www/html/www.sunshineboy.com; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
访问测试
[[email protected] conf]# curl http://192.168.220.25/index.php | grep -o "Two\|One" #访问25,发现One % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0One [[email protected] conf]# curl http://192.168.220.5/index.php | grep -o "Two\|One" #访问192.168.220.5,也是One % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0One 100 491620 491620 0 1328k 0 --:--:-- --:--:-- --:--:-- 1333k [[email protected] conf]# curl http://192.168.220.5/index.php | grep -o "Two\|One" % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0One 100 491620 491620 0 1091k 0 --:--:-- --:--:-- --:--:-- 1116k [[email protected] conf]# curl http://192.168.220.26/index.php | grep -o "Two\|One" #还是One,证明代理成功,动态静态分开了 % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0One 100 492440 492440 0 1297k 0 --:--:-- --:--:-- --:--:-- 1335k
本文出自 “SunshineBoySZF” 博客,请务必保留此出处http://sunshineboyszf.blog.51cto.com/12087328/1865265
以上是关于keepalived+lvs+tomcat+nfs架构部署的主要内容,如果未能解决你的问题,请参考以下文章
LVS(DR)+keepalived+nfs+raid+LVM
web集群综合项目keepalived+lvs+lamp+nfs+mysql
linux服务器 keepalived+nfs+web集群搭建实例