Keepalived基本問題定位方法dom
1,檢查配置文件ide
2, 查看lvs生效配置spa
[root@localhost ~]#ipvsadm -ln日誌
IP Virtual Server version 1.2.1 (size=4096)blog
Prot LocalAddress:Port Scheduler Flags接口
-> RemoteAddress:Port Forward Weight ActiveConn InActConnip
TCP 192.168.230.100:80 rrrem
-> 192.168.230.12:80 Route 1 0 0 get
-> 192.168.230.13:80 Route 1 0 0 it
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