CentOS故障切换群集 – SIOCADDRT:没有这样的过程(当添加一个环回时)

我正在尝试为负载均衡服务器configuration两个Web服务器。 负载平衡方面工作正常(它看到两个服务器,杀死他们,如果需要的话,似乎指挥stream量罚款)。 唯一的问题是服务器循环:

的/ etc / SYSCONFIG /networking的脚本/的ifcfg-LO:0

DEVICE=lo:0 IPADDR=<Virtual IP> NETMASK=255.255.255.255 ONBOOT=yes NAME=loopback 

每次我尝试一个“ 服务networking重新启动 ”时,我得到一个SIOCADDRT:加载回送接口时没有这样的过程

任何人有一个想法是什么造成这个?

每次我尝试一个“服务networking重新启动”时,我得到一个SIOCADDRT:加载回送接口时没有这样的过程。

这通常来自route命令,意味着您正试图通过无效网关设置路由。 例如,如果我有:

 # ip addr list 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether b8:ac:6f:a6:bf:a6 brd ff:ff:ff:ff:ff:ff inet 192.168.1.10/24 brd 192.168.1.255 scope global external 

然后我尝试通过192.168.1.1添加一条路由到192.168.3.0,但是不小心打错了,input错误的网关地址:

 # route add 192.168.3.0/24 gw 192.168.2.1 

然后我得到这个:

 SIOCADDRT: No such process 

如果不是service network restart ,如果你只是使用ifup lo:0 ,会发生什么? 你仍然得到同样的错误?

在别名configuration中添加NO_ALIASROUTING = yes,或者在父设备configuration中添加NO_ALIASROUTING = yes,如果您不需要路由任何别名。 检查你的ifup别名是否支持NO_ALIASROUTING。 如果没有,在你的别名configuration中设置GATEWAY =“”可以做到这一点。

请注意,/usr/share/doc/initscripts-*/sysconfig.txt表示别名设备不应该复制父设备中包含的信息。

 /etc/sysconfig/network-scripts/ifcfg-<interface-name> and /etc/sysconfig/network-scripts/ifcfg-<interface-name>:<alias-name>: The first defines an interface, and the second contains only the parts of the definition that are different in a "alias" (or alternative) interface. For example, the network numbers might be different, but everything else might be the same, so only the network numbers would be in the alias file, but all the device information would be in the base ifcfg file. 

它也说使用ONPARENT而不是ONBOOT

 ONBOOT=yes|no (not valid for alias devices; use ONPARENT) ONPARENT=yes|no Whether to bring up the device when the parent device is brought up. Default: yes 

这让我觉得ONBOOT=yes是不正确的。 如果你使用ONPARENT会发生什么?

 DEVICE=lo:0 IPADDR=<Virtual IP> NETMASK=255.255.255.255 ONBOOT=yes 

更新:

原来这并不重要。 正如larsks所说, /etc/sysconfig/network-scripts/ifup-aliases只检查ONPARENT=no

 for FILE in ifcfg-${parent_device}:* ; do is_ignored_file "$FILE" && continue ini_env; . $FILE; [ -z "$DEVICE" ] && DEVICE=${FILE##ifcfg-} [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface; unset DEVICE done