keepalivedã§ãã§ã¤ã«ããã¯ç¡å¹(nopreempt)ã«ããã¨ãã®æå
keepalivedã«ã¤ãã¦ä»¥åã«ããã¤ãã®ã¨ã³ããªã§ãç´¹ä»ãã¾ããã
ããã2ã¤ã®ã¨ã³ããªã§ç´¹ä»ããkeepalivedã®æè¡ãçµã¿åãããæ§æã§ãåãµã¼ãã§ã®keepalivedã®statusãBACKUPã«ãããã§ã¤ã«ããã¯ç¡å¹(nopreempt)ã«ããã¨ãã®æåã«ã¤ãã¦èª¿æ»ãã¾ããã
ãªã調æ»ããããã¨ããã¾ãã¨ãkeepalivedã®ãã§ã¤ã«ããã¯ã®åä½ã§çåã«æãããã¨ããã£ãããã§ãã
ä»åã®ã·ã¹ãã æ§æã¯ä»¥ä¸ã®å³ã®ããã«ãeth0ã¨eth2ã§bonding(Active-Backup)ãçµãã§ãããããã«bond0ã«2ã¤ã®ä»®æ³IPã¢ãã¬ã¹ããeth1ã«1ã¤ã®ä»®æ³IPã¢ãã¬ã¹ãå²ãå½ã¦ã¾ãã
keepalivedã®è¨å®ã¯こちらã®è¨å®å 容ã¨ã»ã¼åãã§ãvrrp_instance SERVICEã®interfaceãbond0ã«å¤æ´ã¨ãªãã ãã§ãã
ããã§ã¯ãåæç¶æ ã§ã¯server1ã®bond0ããã³eth1ã«ä»®æ³IPãå²ãæ¯ããã¦ããã¨ä»®å®ãã¦ã以ä¸ã®ãããªæ¡ä»¶ã§ã®keepalivedã®æ¯ãèãã確èªãã¦ã¿ã¾ãã
- ä»®æ³IPãå²ãå½ã¦ããã¦ããserver1ããã¦ã³(keepalivedãåæ¢)
- ä»®æ³IPãå²ãå½ã¦ããã¦ããserver1ã®ã¤ã³ã¿ãã§ã¼ã¹ãåæ¢
æ¤è¨¼ãããåã«1ç¹ã ãããããããã¦ããã¾ãã
server1ããã³server2ã®keepalivedã®è¨å®ãã以ä¸ã®ãããªæ¡ä»¶ã®å ´åã¯ãkeepalivedãå
ã«èµ·åããå´ã常ã«MASTERã¨ãªããã¨ãç´æããã¦ãã¾ãã
- statusãBACKUP
- åã¤ã³ã¹ã¿ã³ã¹ã®priorityãåä¸
- nopreempt
ãããããã§ãããkeepalivedãå
ã«èµ·åããå´ã常ã«MASTERã¨ãªãã¾ãã
keepalivedãå
ã«èµ·åããå´ã常ã«MASTERã¨ãªãã¾ãã
keepalivedãå
ã«èµ·åããå´ã常ã«MASTERã¨ãªãã¾ãããã
ããã§ã¯æ¤è¨¼ããã¦ããã¾ãã
server1ããã¦ã³(keepalivedãåæ¢)
ãµã¼ãããã¦ã³ããã¨ããæ³å®ã®ãã¨keepalivedãåæ¢ãã¾ãã
[server1]$ sudo /etc/init.d/keepalived stop
ç¶ãã¦ãæ°ç§å¾ ã£ã¦ããserver2ã§ä»¥ä¸ã®ã³ãã³ããçºè¡ããä»®æ³IPã¢ãã¬ã¹ãå²ãå½ã¦ããã¦ãããã¨ã確èªãã¾ãã
[server2]$ /sbin/ip addr
1: lo:mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: bond0:mtu 1500 qdisc noqueue
link/ether 00:21:5a:ac:78:da brd ff:ff:ff:ff:ff:ff
inet 192.168.2.11/24 brd 192.168.2.254 scope global bond0
inet 192.168.2.1/24 scope global secondary bond0
inet 192.168.2.2/24 scope global secondary bond0
3: eth0:mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: eth1:mtu 1500 qdisc pfifo_fast qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 10.1.2.11/24 brd 10.1.2.254 scope global eth1
inet 10.1.2.1/24 scope global secondary eth1
5: eth2:mtu 1500 qdisc pfifo_fast master bond0 qlen 100
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
server1ã復æ§ããã¨ä»®å®ããkeepalivedãèµ·åãã¾ãã
[server1]$ sudo /etc/init.d/keepalived start
æ°ç§å¾
æ©ãã¦ããå度server2ã§ä»®æ³IPã¢ãã¬ã¹ãå²ãæ¯ããã¦ãããã©ããã確èªãã¾ãã
ããã¨ä»®æ³IPã¢ãã¬ã¹ã¯server2ã«å²ãå½ã¦ãããã¾ã¾ã¨ãªã£ã¦ããããã§ã¤ã«ããã¯ãç¡å¹ã«ãªã£ã¦ãããã¨ã確èªã§ãã¾ãã
[server2]$ /sbin/ip addr
1: lo:mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: bond0:mtu 1500 qdisc noqueue
link/ether 00:21:5a:ac:78:da brd ff:ff:ff:ff:ff:ff
inet 192.168.2.11/24 brd 192.168.2.254 scope global bond0
inet 192.168.2.1/24 scope global secondary bond0
inet 192.168.2.2/24 scope global secondary bond0
3: eth0:mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: eth1:mtu 1500 qdisc pfifo_fast qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 10.1.2.11/24 brd 10.1.2.254 scope global eth1
inet 10.1.2.1/24 scope global secondary eth1
5: eth2:mtu 1500 qdisc pfifo_fast master bond0 qlen 100
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
念ã®ããã«server2ã§åå¾ãããã°ã確èªãã¦ããã¾ãã
[server2]$ sudo view /var/log/message
Oct 23 22:38:10 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Transition to MASTER STATE
Oct 23 22:38:10 server2 Keepalived_vrrp: VRRP_Group(VG) Syncing instances to MASTER state
Oct 23 22:38:10 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Transition to MASTER STATE
Oct 23 22:38:10 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Entering MASTER STATE
Oct 23 22:38:10 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) setting protocol VIPs.
Oct 23 22:38:10 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Sending gratuitous ARPs on eth1 for 10.1.2.1
Oct 23 22:38:13 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Entering MASTER STATE
Oct 23 22:38:13 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) setting protocol VIPs.
Oct 23 22:38:13 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.1
Oct 23 22:38:13 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.2
Oct 23 22:38:15 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Sending gratuitous ARPs on eth1 for 10.1.2.1
Oct 23 22:38:18 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.1
Oct 23 22:38:18 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.2
ãã¨ãã¨server2ã«ä»®æ³IPã¢ãã¬ã¹ã¯å²ãå½ã¦ããã¦ããããBACKUPã§åä½ãã¦ãã¾ããããserver1ã®keepalivedãåæ¢ãã¦server2ãMASTERã«ãªã£ã¦ãã¾ãã
server2ãMASTERã«ãªã£ã¦ããGARPãéåºãã¦ããã¯server1ã復æ§ãã¦ãã¹ãã¼ã¿ã¹ã¯å¤ãã£ã¦ãã¾ããã
server1ã®bond0ã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³ããã¦ãæ°ç§å¾ã«bond0ã復æ§ãããå ´å
ããã§ã¯ä»®æ³IPã¢ãã¬ã¹ãå²ãå½ã¦ããã¦ããserver1ã®bond0ã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³ããã¾ãã
ãã¦ã³ãããæå»ã¯22:17:26ã§ãã
[server1]$ sudo /sbin/ifdown bond0
ä»®æ³IPã¢ãã¬ã¹ãserver2ã«å¼ãç¶ããããã¨ã確èªãã¦ãbond0ã¤ã³ã¿ãã§ã¼ã¹ãã¢ããããã¾ãã
ã¢ãããããæå»ã¯22:18:08ã§ãã
ãã®æã®server2ã§ã®tcpdumpã®çµæã¯ä»¥ä¸ã®éãã§ãã
[server2]$ sudo /usr/sbin/tcpdump -i bond0 -n vrrp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bond0, link-type EN10MB (Ethernet), capture size 96 bytes
22:17:20.122825 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:23.123700 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:26.124602 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:29.126464 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:38.736333 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:41.738310 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:44.739085 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:47.739966 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:50.740848 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:53.741736 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:56.742617 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:17:59.743500 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:02.744383 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:05.745267 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:08.747166 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:10.566840 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:13.567906 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:16.568602 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:18:19.570474 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
ä¸è¨ã®ãªãã¬ã¼ã·ã§ã³ã®çµæãserver1ããserver2ã«ãã§ã¤ã«ãªã¼ãããserver1ã®bond0ã復æ§ããã¨ãã§ã¤ã«ããã¯ãã¦ãã¾ãã
ããã«ãã®ã¨ãã®server2ã®ãã°ã念ã®ããã«ç¢ºèªãã¦ããã¾ãã
[server2]$ view /var/log/message
Oct 23 22:17:38 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Transition to MASTER STATE
Oct 23 22:17:38 server2 Keepalived_vrrp: VRRP_Group(VG) Syncing instances to MASTER state
Oct 23 22:17:38 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Transition to MASTER STATE
Oct 23 22:17:39 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Entering MASTER STATE
Oct 23 22:17:39 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) setting protocol VIPs.
Oct 23 22:17:39 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Sending gratuitous ARPs on eth1 for 10.1.2.1
Oct 23 22:17:41 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Entering MASTER STATE
Oct 23 22:17:41 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) setting protocol VIPs.
Oct 23 22:17:41 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.1
Oct 23 22:17:41 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.2
Oct 23 22:17:44 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Sending gratuitous ARPs on eth1 for 10.1.2.1
Oct 23 22:17:46 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.1
Oct 23 22:17:46 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.2
Oct 23 22:18:10 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Received higher prio advert
Oct 23 22:18:10 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Entering BACKUP STATE
Oct 23 22:18:10 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) removing protocol VIPs.
Oct 23 22:18:10 server2 Keepalived_vrrp: VRRP_Group(VG) Syncing instances to BACKUP state
Oct 23 22:18:10 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Entering BACKUP STATE
Oct 23 22:18:10 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) removing protocol VIPs.
Oct 23 22:18:20 server2 kernel: device eth0 left promiscuous mode
Oct 23 22:18:20 server2 kernel: device bond0 left promiscuous mode
â»æå¾ã®promiscuos modeã®åºåã«ã¤ãã¦ã¯ãtcpdumpãå©ç¨ããããã§ãã
ãã®ãã°ã§ããããªç¹ã1ã¤ããã¾ãã
ããã¯server2ã®tcpdumpã®çµæã§ã¯ãserver1ããã³server2ãéåºãã¦ããpriorityã¯äºãã«100ãªã®ã«ãserver2ãReceived higher prio advertã¨å¤æããMASTERããBACKUPã«é·ç§»ãã¦ãã¾ãã
ä¸è¨ã®çµæãããkeepalivedããã¦ã³ãããã¨ãªãã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³ãã¦ç¶æ ãå¤åããå ´åã¯ãã¤ã³ã¿ãã§ã¼ã¹ã復æ§ããã¨ãã§ã¤ã«ããã¯ãããã¨ããããã¾ããã
server1ã®bond0,eth1ã¤ã³ã¿ãã§ã¼ã¹ãé ã«ãã¦ã³ããã¦ãæ°ç§å¾ã«bond0,eth1ãé ã«å¾©æ§ãããå ´å
server1ã§ã®ãªãã¬ã¼ã·ã§ã³ã¯ä»¥ä¸ã®éãã§ãã
[server1]$ sudo /sbin/ifdown bond0ãï¼22:25:34ãã
[server1]$ sudo /sbin/ifdown eth1ã ï¼22:25:59ãã
[server1]$ sudo /sbin/ifup bond0ãï¼22:26:20ãã
[server1]$ sudo /sbin/ifup eth1ã ï¼22:26:38ãã
ãã®æã®server2ã§ã®tcpdumpã®çµæã¯ä»¥ä¸ã®éãã§ãã
[server2]$ sudo /usr/sbin/tcpdump -i bond0 -n vrrp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bond0, link-type EN10MB (Ethernet), capture size 96 bytes
22:25:31.700178 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:34.701045 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:44.311161 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:47.312136 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:50.312908 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:53.313783 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:56.314660 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:25:59.315536 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:02.316413 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:05.317290 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:08.318166 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:11.319045 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:14.319921 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:17.320798 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:20.321676 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:23.322552 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:26.323428 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:29.324306 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:32.325181 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:35.326060 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:38.326935 IP 192.168.2.11 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:38.332457 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:47.937151 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:50.937875 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:53.939751 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:56.940623 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:26:59.941500 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:27:02.942375 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:27:05.943249 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:27:08.944125 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:27:11.945000 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:27:14.945876 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
22:27:17.946749 IP 192.168.2.10 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 3s, length 24
ã¾ããserver2ã®ãã°ã¯ä»¥ä¸ã®éãã§ãã
[server2]$ view /var/log/message
Oct 23 22:25:44 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Transition to MASTER STATE
Oct 23 22:25:44 server2 Keepalived_vrrp: VRRP_Group(VG) Syncing instances to MASTER state
Oct 23 22:25:44 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Transition to MASTER STATE
Oct 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Entering MASTER STATE
Octy 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) setting protocol VIPs.
Oct 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Sending gratuitous ARPs on eth1 for 10.1.2.1
Oct 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Entering MASTER STATE
Oct 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) setting protocol VIPs.
Oct 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.1
Oct 23 22:25:47 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.2
Oct 23 22:25:52 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Sending gratuitous ARPs on eth1 for 10.1.2.1
Oct 23 22:25:52 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.1
Oct 23 22:25:52 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Sending gratuitous ARPs on bond0 for 192.168.226.2
Oct 23 22:26:38 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Received higher prio advert
Oct 23 22:26:38 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) Entering BACKUP STATE
Oct 23 22:26:38 server2 Keepalived_vrrp: VRRP_Instance(BACKEND) removing protocol VIPs.
Oct 23 22:26:38 server2 Keepalived_vrrp: VRRP_Group(VG) Syncing instances to BACKUP state
Oct 23 22:26:38 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) Entering BACKUP STATE
Oct 23 22:26:38 server2 Keepalived_vrrp: VRRP_Instance(SERVICE) removing protocol VIPs.
Oct 23 22:27:18 server2 kernel: device eth0 left promiscuous mode
Oct 23 22:27:18 server2 kernel: device bond0 left promiscuous mode
以ä¸ãããserver1ã®bond0ã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³ããã¦ãæ°ç§å¾ã«bond0ã復æ§ãããå ´åã¨åãçµæã¨ãªã£ã¦ãããã¨ã確èªã§ãã¾ããã
çµè«
ä»åã®æ¤è¨¼ãã以ä¸ã®ãã¨ã確èªã§ãã¾ããã
- keepalivedã®ãµã¼ãã¹ãåæ¢ãã¦ããããµã¼ãã¹ãèµ·åããªããã¦ããã§ã¤ã«ããã¯ããªã
- keepalivedã§ã¯æå³çã«ã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³ãããå ´åã¯ããã§ã¤ã«ããã¯ãã
ãã ããä»åæ¤è¨¼ããã®ã¯ç¹å®ã®ã¤ã³ã¿ãã§ã¼ã¹ã®ã¿ããã¦ã³ããããæ¹ã§ããããµã¼ãã®å
¨ã¦ã®ã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³(/etc/init.d/network stop)ããçµæã§ã¯ããã¾ããã
ã¾ããã¤ã³ã¿ãã§ã¼ã¹ããã¦ã³ãããã®ã§ã¯ãªããLANã±ã¼ãã«ãæããå ´åã«ã©ã®ãããªæ¯ãèãã«ãªããã«ã¤ãã¦ãèæ
®ããã¦ãã¾ããã
ä»åã®çµæãããkeepalivedãå
ã«èµ·åããå´ã常ã«MASTERã¨ãªããã¨ã確èªã§ãã¾ããã®ã§ããããããµã¼ãå
¨ã¦ã®ãããã¯ã¼ã¯ããã¦ã³ããããLANã±ã¼ãã«ãæãå·®ããã¦ããã§ã¤ã«ããã¯ããã®ã§ã¯ãªããã¨èãããã¾ãã