免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2182 | 回复: 1
打印 上一主题 下一主题

为何备机的浮动ip自己down掉了 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-24 22:57 |只看该作者 |倒序浏览
环境描述:
  主机: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]#

论坛徽章:
0
2 [报告]
发表于 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 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP