您的位置:首页 > 其它

基于lvs(DR模式)的keepalived部署

2018-01-16 07:14 771 查看
服务器列表:
角色             内网ip                外网ip
路由器         192.168.8.82     192.168.8.253
lvs1服务器   192.168.8.81     192.168.8.252
lvs2服务器   192.168.8.83     192.168.8.252
web服务器   192.168.8.84     192.168.8.252


路由器配置:
a. 内网配置:



b. 外网配置:



c. 开启路由转发:



d. 防火墙设置路由转发规则(可选):



lvs1服务器配置:
a. 内网ip:



b. 外网ip:



c. keepalived配置文件:



d. 配置文件源代码:
! Configuration File for keepalived`
global_defs {
notification_email {
complet@163.com
}
notification_email_from root@localhost.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id lvs_1
}
vrrp_instance LVS_HA {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.8.252/32
}
}
virtual_server 192.168.8.252 80 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.255
persistence_timeout 50
protocol TCP
real_server 192.168.8.84 80 {
weight 1
TCP_CHECK {
connect_timeout 20
connect_port 80
nb_get_retry 3
}
}


lvs2服务器配置(参照lvs1)

web服务器配置:
a. 内网ip:



b. 外网ip:



c. 避免地址冲突:



浏览器访问(192.168.8.252):

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  lvs 基于 DR