Chinaunix

标题: 为何备机的浮动ip自己down掉了 [打印本页]

作者: carhj    时间: 2008-10-24 22:57
标题: 为何备机的浮动ip自己down掉了
环境描述:
  主机:eth1(外网ip):221.179.0.80,eth0(内网心跳ip):192.168.0.80
   备机:eth1(外网ip):221.179.0.81,eth0(内网心跳ip):192.168.0.81
   浮动ip:分别绑定在主备机的eth1:0:221.179.0.82
   整个环境,就这两台机器。dr放在主机上了,rs分别在主,备机。
问题描述:
  主机先启动,一切正常。
  备机后启动,大约10来秒后,绑定的浮动ip自动被down了
详细日志:
  主机(正常):
[root@GD_HS21_G021 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:5E:2C:48:9E  
          inet addr:192.168.0.80  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::221:5eff:fe2c:489e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:883 errors:0 dropped:0 overruns:0 frame:0
          TX packets:915 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:163354 (159.5 KiB)  TX bytes:193698 (189.1 KiB)
          Interrupt:209 Memory:da000000-da012100

eth1      Link encap:Ethernet  HWaddr 00:21:5E:2C:48:A0  
          inet addr:221.179.0.80  Bcast:221.179.0.95  Mask:255.255.255.224
          inet6 addr: fe80::221:5eff:fe2c:48a0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2787 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1050 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:488016 (476.5 KiB)  TX bytes:126630 (123.6 KiB)
          Interrupt:193 Memory:d8000000-d8012100

eth1:0    Link encap:Ethernet  HWaddr 00:21:5E:2C:48:A0  
          inet addr:221.179.0.82  Bcast:221.179.0.95  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:193 Memory:d8000000-d8012100

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1821 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1821 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1747204 (1.6 MiB)  TX bytes:1747204 (1.6 MiB)

[root@GD_HS21_G021 ~]#
  备机(注意最后一次ifconfig,eth1:0则down掉了):
[root@GD_HS21_G022 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:5E:2C:47E  
          inet addr:192.168.0.81  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::221:5eff:fe2c:47de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7161 (6.9 KiB)  TX bytes:7474 (7.2 KiB)
          Interrupt:209 Memory:da000000-da012100

eth1      Link encap:Ethernet  HWaddr 00:21:5E:2C:47:E0  
          inet addr:221.179.0.81  Bcast:221.179.0.95  Mask:255.255.255.224
          inet6 addr: fe80::221:5eff:fe2c:47e0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:348 errors:0 dropped:0 overruns:0 frame:0
          TX packets:458 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:34020 (33.2 KiB)  TX bytes:50196 (49.0 KiB)
          Interrupt:193 Memory:d8000000-d8012100

eth1:0    Link encap:Ethernet  HWaddr 00:21:5E:2C:47:E0  
          inet addr:221.179.0.82  Bcast:221.179.0.95  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:193 Memory:d8000000-d8012100

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1683 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1683 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2235046 (2.1 MiB)  TX bytes:2235046 (2.1 MiB)

[root@GD_HS21_G022 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:5E:2C:47E  
          inet addr:192.168.0.81  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::221:5eff:fe2c:47de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7627 (7.4 KiB)  TX bytes:7745 (7.5 KiB)
          Interrupt:209 Memory:da000000-da012100

eth1      Link encap:Ethernet  HWaddr 00:21:5E:2C:47:E0  
          inet addr:221.179.0.81  Bcast:221.179.0.95  Mask:255.255.255.224
          inet6 addr: fe80::221:5eff:fe2c:47e0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:360 errors:0 dropped:0 overruns:0 frame:0
          TX packets:473 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35131 (34.3 KiB)  TX bytes:51762 (50.5 KiB)
          Interrupt:193 Memory:d8000000-d8012100

eth1:0    Link encap:Ethernet  HWaddr 00:21:5E:2C:47:E0  
          inet addr:221.179.0.82  Bcast:221.179.0.95  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:193 Memory:d8000000-d8012100

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1731 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1731 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2243149 (2.1 MiB)  TX bytes:2243149 (2.1 MiB)

[root@GD_HS21_G022 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:5E:2C:47E  
          inet addr:192.168.0.81  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::221:5eff:fe2c:47de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7856 (7.6 KiB)  TX bytes:8456 (8.2 KiB)
          Interrupt:209 Memory:da000000-da012100

eth1      Link encap:Ethernet  HWaddr 00:21:5E:2C:47:E0  
          inet addr:221.179.0.81  Bcast:221.179.0.95  Mask:255.255.255.224
          inet6 addr: fe80::221:5eff:fe2c:47e0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:379 errors:0 dropped:0 overruns:0 frame:0
          TX packets:507 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:36605 (35.7 KiB)  TX bytes:55196 (53.9 KiB)
          Interrupt:193 Memory:d8000000-d8012100

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1731 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1731 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2243149 (2.1 MiB)  TX bytes:2243149 (2.1 MiB)


主机网卡配置文件:
[root@GD_HS21_G021 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@GD_HS21_G021 network-scripts]# more ifcfg-eth0 ifcfg-eth1 ifcfg-eth1:0
::::::::::::::
ifcfg-eth0
::::::::::::::
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.80
NETMASK=255.255.255.0
::::::::::::::
ifcfg-eth1
::::::::::::::
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=221.179.0.80
NETMASK=255.255.255.224
GATEWAY=221.179.0.65
::::::::::::::
ifcfg-eth1:0
::::::::::::::
DEVICE=eth1:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=221.179.0.82
NETMASK=255.255.255.224
GATEWAY=221.179.0.65
[root@GD_HS21_G021 network-scripts]#
备机网卡配置文件:
[root@GD_HS21_G022 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@GD_HS21_G022 network-scripts]# more ifcfg-eth0 ifcfg-eth1 ifcfg-eth1:0
::::::::::::::
ifcfg-eth0
::::::::::::::
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.81
NETMASK=255.255.255.0
::::::::::::::
ifcfg-eth1
::::::::::::::
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=221.179.0.81
NETMASK=255.255.255.224
GATEWAY=221.179.0.65
::::::::::::::
ifcfg-eth1:0
::::::::::::::
DEVICE=eth1:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=221.179.0.82
NETMASK=255.255.255.224
GATEWAY=221.179.0.65
[root@GD_HS21_G022 network-scripts]#
作者: gl00ad    时间: 2008-10-25 03:47
标题: that is the way it should be
浮动ip:分别绑定在主备机的eth1:0:221.179.0.82, but it should only active one at a time

packet-->(ethernet)-->221.179.0.82-->HWaddr 00:21:5E:2C:48:A0(80, not 81)

I just copy from redhat document

If the backup LVS router does not receive a response from the active LVS router, it initiates
failover by calling send_arp to reassign all virtual IP addresses to the NIC hardware addresses
(MAC address) of the backup LVS router
, sends a command to the active LVS router via both
the public and private network interfaces to shut down the lvs daemon on the active LVS
router, and starts the lvs daemon on the backup LVS router to accept requests for the
configured virtual servers.


[ 本帖最后由 gl00ad 于 2008-10-25 03:52 编辑 ]




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2