其他分享
首页 > 其他分享> > Keepalived配置报错Unicast peers are not supported in strict mode

Keepalived配置报错Unicast peers are not supported in strict mode

作者:互联网

Keepalived配置报错Unicast peers are not supported in strict mode

报错信息

Oct 14 19:18:45 ka1 Keepalived_vrrp[1306]: (Web_1) Strict mode does not support authentication. Ignoring.
Oct 14 19:18:45 ka1 Keepalived_vrrp[1306]: (Web_1) Unicast peers are not supported in strict mode
Oct 14 19:18:45 ka1 Keepalived_vrrp[1306]: Stopped - used 0.000000 user time, 0.001451 system time
Oct 14 19:18:45 ka1 Keepalived[1305]: Startup complete
Oct 14 19:18:45 ka1 Keepalived[1305]: pid 1306 exited with permanent error CONFIG. Terminating
Oct 14 19:18:45 ka1 Keepalived[1305]: CPU usage (self/children) user: 0.000000/0.000000 system: 0.001419/0.001747
Oct 14 19:18:45 ka1 Keepalived[1305]: Stopped Keepalived v2.2.4 (08/21,2021)

报错原因

vrrp_strict 严格模式和unicast_src_ip冲突,造成keepalived启动失败
此外vrrp_strict 还和nopreempt等配置冲突,建议直接删除或注释.

排除错误

vi /etc/keepalived/keepalived.conf

注释或删除下列行

#vrrp_strict

保存后重启keepalived

systemctl restart keepalived

在这里插入图片描述

题外话

排错过程中看到其他同学的Keepalived求助帖
https://ask.csdn.net/questions/771124?weChatOA=
虽然不知道最终的原因,但也对该问题做了下分析

问题分两步
一.抢占引起的vip自动切换
1.43为主,当43启动后虚拟ip切换到43,这个是抢占模式引起的.
解决方法:将keepalived设置成非枪战模式,这样你停了43,切到47后,再次启动43不会强制再把VIP切回43.
vrrp_instance中增加nopreempt
二.vip在43上无法访问.
vip无法访问,这里不是很理解描述的"无法访问"具体现象,揣测有3种可能.
1vip无法ping通
看下防火墙配置
systemctl stop firewalld && iptables -F (请再三确认防火墙配置,避免造成部分需要的配置丢失)
2keepalived的配置,理论上你没有配置vrrp_strict是不需要单独配置vrrp_iptables,但你没说具体keepalived版本,不排除小版本存在某些特殊的bug
global_defs 中加vrrp_iptables
3.某个服务比如nginx或者apache无法访问
3.1.检查对应配置文件的listen配置项,最粗暴的方式设置成0.0.0.0
3.2.ss -ntlp 查看对应端口的监听
3.3.利用curl之类的工具依次测试127.0.0.1,服务器ip,vip看是否正常返回.
3.4.数据库的话查看相关账号授权

标签:peers,14,Keepalived,supported,keepalived,strict,vrrp,报错,Oct
来源: https://blog.csdn.net/qq_29974229/article/details/120760434