Keepalived基本问题定位方法
1,检查配置文件
2, 查看lvs生效配置
[root@localhost ~]#ipvsadm -ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.230.100:80 rr
-> 192.168.230.12:80 Route 1 0 0
-> 192.168.230.13:80 Route 1 0 0
3,查看keepalived状态:
[root@localhost keepalived]# servicekeepalived status
Redirecting to /bin/systemctl status keepalived.service
keepalived.service - LVS and VRRP HighAvailability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled)
Active: inactive (dead) since Thu 2016-08-25 11:21:06CST; 6s ago
# Active: inactive(dead)非活动状态
4,查看记录的日志
Redirecting to /bin/systemctl status keepalived.service
Aug 25 11:46:23 localhost.localdomainKeepalived_vrrp[1480]: VRRP_Instance(VI_1) Received higher prio advert
Aug 25 11:46:23 localhost.localdomainKeepalived_vrrp[1480]: VRRP_Instance(VI_1) EnteringBACKUP STATE #切换为备状态
Aug 25 11:46:23 localhost.localdomainKeepalived_vrrp[1480]: VRRP_Instance(VI_1) removing protocol VIPs.
Aug 25 11:46:23 localhost.localdomainKeepalived_healthcheckers[1477]: Netlink reflector reports IP 192.168.230.100removed
5, 查看vrrp报文,特别注意vid是否一致。
6, 查看接口状态
7,查看IPVS连接状态信息
[root@localhost ~]# ipvsadm -lcn
IPVS connection entries
pro expire state source virtual destination
TCP 01:56 FIN_WAIT 192.168.230.15:46655192.168.230.100:80 192.168.230.12:80
TCP 01:57 FIN_WAIT 192.168.230.15:46656192.168.230.100:80 192.168.230.13:80
8,查看接口属性
[root@localhost ~]# sysctl -a |grepnet.ipv4.ip_forward
[root@localhost ~]# sysctl -a |greparp_ignore
[root@localhost ~]# sysctl -a |greparp_announce
9, 查看系统日志
[root@localhost ~]# tail /var/log/messages
转载于:https://blog.51cto.com/dingtongxue1990/1842467