ifconfig查看多了几个IP地址

各位好!

我配置了heartbeat+ldirector。配置了两个VIP,对应不同的域名。vip1=eth0:0 192.168.10.67 vip2=eth0:1 192.168.10.68 测试heartbeat+ldirector都在正常。
通过ifconfig查看:多了eth0:2,eth0:3,且广播地址,子网掩码变了。

eth0 Link encap:Ethernet HWaddr 00:30:48:56:7D:CB
inet addr:192.168.10.109 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:917182 errors:0 dropped:0 overruns:0 frame:0
TX packets:536539 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:136176224 (129.8 Mb) TX bytes:50048919 (47.7 Mb)
Base address:0xb800 Memory:fc9c0000-fc9e0000

eth0:0 Link encap:Ethernet HWaddr 00:30:48:56:7D:CB
inet addr:192.168.10.67 Bcast:192.168.10.67 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:966464 (943.8 Kb)
Base address:0xb800 Memory:fc9c0000-fc9e0000

eth0:1 Link encap:Ethernet HWaddr 00:30:48:56:7D:CB
inet addr:192.168.10.68 Bcast:192.168.10.68 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:966464 (943.8 Kb)
Base address:0xb800 Memory:fc9c0000-fc9e0000

eth0:2 Link encap:Ethernet HWaddr 00:30:48:56:7D:CB
inet addr:192.16.10.67 Bcast:192.16.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:966464 (943.8 Kb)
Base address:0xb800 Memory:fc9c0000-fc9e0000

eth0:3 Link encap:Ethernet HWaddr 00:30:48:56:7D:CB
inet addr:192.16.10.68 Bcast:192.16.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:966464 (943.8 Kb)
Base address:0xb800 Memory:fc9c0000-fc9e0000

eth1 Link encap:Ethernet HWaddr 00:30:48:56:7D:CA
inet addr:172.16.10.109 Bcast:172.16.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:966464 (943.8 Kb)
Base address:0xbc00 Memory:fc9e0000-fca00000

通过查看日志,找到了如下的提示,这样会影响使用吗?有办法把这个取消吗?谢谢您的回复。
5 OK yes
Apr 16 13:14:03 LVSMasterServer01 ResourceManager[1703]: info: Acquiring resource group: lvsmasterserver01 IPaddr::192.16.10.67/24/eth0:0/192.168.10.255 ldirectord
Apr 16 13:14:03 LVSMasterServer01 IPaddr[1727]: INFO: IPaddr Resource is stopped
Apr 16 13:14:03 LVSMasterServer01 ResourceManager[1703]: info: Running /etc/ha.d/resource.d/IPaddr 192.16.10.67/24/eth0:0/192.168.10.255 start
Apr 16 13:14:03 LVSMasterServer01 IPaddr[1941]: INFO: /sbin/ifconfig eth0:2 192.16.10.67
Apr 16 13:14:03 LVSMasterServer01 IPaddr[1941]: INFO: Sending Gratuitous Arp for 192.16.10.67 on eth0:2 [eth0]
Apr 16 13:14:03 LVSMasterServer01 IPaddr[1941]: INFO: /usr/lib/heartbeat/send_arp -i 500 -r 10 -p /var/run/heartbeat/rsctmp/send_arp/send_arp-192.16.10.67 eth0 192.16.10.67 auto 192.16.10.67 ffffffffffff
Apr 16 13:14:03 LVSMasterServer01 IPaddr[1859]: INFO: IPaddr Success
Apr 16 13:14:04 LVSMasterServer01 ResourceManager[1703]: info: Running /etc/ha.d/resource.d/ldirectord start
Apr 16 13:14:04 LVSMasterServer01 ldirectord: Invoking ldirectord invoked as: /usr/sbin/ldirectord start
Apr 16 13:14:04 LVSMasterServer01 ldirectord: Starting ldirectord succeeded
Apr 16 13:14:04 LVSMasterServer01 harc[2059]: info: Running /etc/ha.d/rc.d/ip-request-resp ip-request-resp
Apr 16 13:14:05 LVSMasterServer01 ip-request-resp[2059]: received ip-request-resp IPaddr::192.16.10.68/24/eth0:1/192.168.10.255 OK yes
Apr 16 13:14:05 LVSMasterServer01 ResourceManager[2074]: info: Acquiring resource group: lvsmasterserver01 IPaddr::192.16.10.68/24/eth0:1/192.168.10.255 ldirectord
Apr 16 13:14:05 LVSMasterServer01 IPaddr[2098]: INFO: IPaddr Resource is stopped
Apr 16 13:14:05 LVSMasterServer01 ResourceManager[2074]: info: Running /etc/ha.d/resource.d/IPaddr 192.16.10.68/24/eth0:1/192.168.10.255 start
Apr 16 13:14:05 LVSMasterServer01 IPaddr[2312]: INFO: /sbin/ifconfig eth0:3 192.16.10.68
Apr 16 13:14:05 LVSMasterServer01 IPaddr[2312]: INFO: Sending Gratuitous Arp for 192.16.10.68 on eth0:3 [eth0]
Apr 16 13:14:05 LVSMasterServer01 IPaddr[2312]: INFO: /usr/lib/heartbeat/send_arp -i 500 -r 10 -p /var/run/heartbeat/rsctmp/send_arp/send_arp-192.16.10.68 eth0 192.16.10.68 auto 192.16.10.68 ffffffffffff

Forums:

我的猜想是,你自己手动设置了eth0:1和eth0:2。而在heartbeat的配置文件/etc/ha.d/haresources中又增加了 IPaddr配置,heartbeat就会自动为你生成 eth0:2, eth0:3两个interface并分别配置了两个VIP,heartbeat默认采用255.255.255.0的子网掩码。
一个解决办法是:你不需要手动增加eth0:1和eth0:2, 只要在haresources里面配置IPaddr::192.168.10.67/32/eth0 IPaddr::192.168.10.68/32/eth0就可以了。

谢谢您的帮助。后来我仔细看了配置文件。结果是/etc/ha.d/haresource的IPaddr::192.168.10.67/32/eth0 IPaddr::192.168.10.68/32/eth0搞错了,原来是192.16.10.67和192.16.10.68

I really wish there were more areclits like this on the web.

That's really thkniing at a high level