I've installed keepalived IP failover software as described here. But how do I verify it is working or not?
By default keepalived uses 188.8.131.52 IP address for VRRP (Virtual Router Redundancy Protocol) for communication between two nodes for health check. All you have to do is run tcpdump as follows on eth0 (or eth1) to make sure communication is established:
tcpdump -v -i eth0 host 184.108.40.206
tcpdump -vvv -n -i eth0 host 220.127.116.11
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 16:54:01.743275 IP (tos 0x0, ttl 255, id 451, offset 0, flags [none], proto: VRRP (112), length: 96) 10.10.28.5 > 18.104.22.168: VRRPv2, Advertisement, vrid 51, prio 103, authtype simple, intvl 1s, length 76, addrs(15): 22.214.171.124,126.96.36.199[|vrrp] 16:54:02.744241 IP (tos 0x0, ttl 255, id 452, offset 0, flags [none], proto: VRRP (112), length: 96) 10.10.28.5 > 188.8.131.52: VRRPv2, Advertisement, vrid 51, prio 103, authtype simple, intvl 1s, length 76, addrs(15): 184.108.40.206,220.127.116.11[|vrrp]
- 10.10.28.5 - your eth0 ip.
- 18.104.22.168 and 22.214.171.124 - Virtual IPs manage by keepalived.
- 126.96.36.199 - multicast request.
If you do not see any communication, than make sure keepalived service started on both nodes:
# service keepalived status
# service keepalived start
Make sure firewall is configured to accept accept multicast and vrrp protocol (IP Protocol # 112):
# /sbin/iptables -I INPUT -i eth0 -d 188.8.131.52/8 -j ACCEPT
# /sbin/iptables -A INPUT -p 112 -i eth0 -j ACCEPT
# /sbin/iptables -A OUTPUT -p 112 -o eth0 -j ACCEPT
# /sbin/service iptables save
Adjust above rules as per your interface and other requirements.
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop