Centos7中,keepalived+lvs安装完成,可以访问VIP,然后重启电脑后,VIP无法显示,无法ping通,重启keepalived也没用,防火墙、selinux都处于关闭状态
/etc/keepalived/keepalived.conf文件内容
global_defs {
router_id 50
}
vrrp_instance VI_1 {
state MASTER
interface ens33
virtual_router_id 1
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 123456
}
virtual_ipaddress {
192.168.100.200
}
}
virtual_server 192.168.100.200 80 {
delay_loop 15
lb_algo rr
lb_kind DR
protocol TCP
real_server 192.168.100.102 80 {
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_before_retry 4
}
}
real_server 192.168.100.3 80 {
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_before_retry 4
}
}
}
重启keepalived结果:
[root@localhost keepalived]# systemctl restart keepalived
尝试ping,发现无法ping通
查看日志
求解决方案