When doing ha, you need to design a virtual IP for the server, that is, a host corresponding to multiple IP addresses? It just sounded so amazing, it was possible.
I looked at the link below.
http://hi.baidu.com/pbottle/item/7175d29702a0a0bd83d29533
The alias is referenced at eth0 and the subnet mask is set
Ifconfig eth0:0 166.111.69.100 netmask 255.255.255.0 up
Ifconfig viewing the information at this time
Click (here) to collapse or open
- Eth0 Link encap:ethernet HWaddr 08:00:27:64:59:11
- inet addr:166.111.69.17 bcast:166.111.69.255 mask:255.255.255.0
- Inet6 ADDR:2402:F000:1:4412:A00:27FF:FE64:5911/64 Scope:global
- Inet6 ADDR:FE80::A00:27FF:FE64:5911/64 Scope:link
- Up broadcast RUNNING multicast mtu:1500 metric:1
- RX packets:597673 errors:0 dropped:0 overruns:0 frame:0
- TX packets:215472 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:67285933 (67.2 MB) TX bytes:22782158 (22.7 MB)
- eth0:0 Link encap:ethernet HWaddr 08:00:27:64:59:11
- inet addr:166.111.69.100 bcast:166.111.69.255 mask:255.255.255.0
- Up broadcast RUNNING multicast mtu:1500 metric:1
- 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:843 errors:0 dropped:0 overruns:0 frame:0
- TX packets:843 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:67174 (67.1 kb) TX bytes:67174 (67.1 KB)
Then find another machine to ping the VIP (eth0:0) to see the results.
Write in the/etc/rc.local also can, write here not afraid of power after the machine can not be normal use.
How to set up VIP (virtual IP) under Linux