比如我的各ubuntu的虚拟机镜像的IP是
192.168.88.129 server-1
192.168.88.130 server-2
192.168.88.131 server-3
在ubuntu的\etc\hosts中添加各主机的映射,比如server-1
127.0.0.1 localhost
127.0.0.1 hostname
127.0.1.1 server-1
192.168.88.129 server-1
192.168.88.130 server-2
192.168.88.131 server-3
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters