第二节:常见问题及解决方式

一、keepalived 脑裂

由于某些原因,导致两台keepalived高可用服务器在指定时间内,无法检测到对方的心跳,各自取得资源及服务的所有权,而此时的两台高可用服务器又都还活着。

1.脑裂的故障

1.网线松动,网络故障
2.服务器硬件故障
3.服务器之间开启了防火墙

2.脑裂模拟

1)开启防火墙

[root@lb01 ~]# systemctl start firewalld.service 
[root@lb01 ~]# ip addr | grep 10.0.0.3
    inet 10.0.0.3/32 scope global eth0

[root@lb02 ~]# systemctl start firewalld
[root@lb02 ~]# ip addr | grep 10.0.0.3
    inet 10.0.0.3/32 scope global eth0

2)访问网站

#因为开启了firewalld防火墙,默认拒绝所有连接,要开启80端口
[root@lb01 ~]# firewall-cmd --add-service=http
success
[root@lb02 ~]# firewall-cmd --add-service=http
success

[root@lb01 ~]# firewall-cmd --add-service=https
success
[root@lb02 ~]# firewall-cmd --add-service=https
success

#访问页面没有任何问题

3)关闭防火墙

[root@lb02 ~]# systemctl stop firewalld.service 
[root@lb02 ~]# ip addr | grep 10.0.0.3

[root@lb01 ~]# systemctl stop firewalld.service
[root@lb01 ~]# ip addr | grep 10.0.0.3
    inet 10.0.0.3/32 scope global eth0

3.脑裂解决的办法

联系管理员微信tutu19192010,注册账号

上一篇
下一篇
Copyright © 2022 Egon的技术星球 egonlin.com 版权所有 帮助IT小伙伴学到真正的技术