一 问题描述
已经使用Vmware配置好了三台虚拟机环境,静态IP设置ok。
这个时候,因为需要实验,又去新开了一台虚拟机(这台虚拟机IP和当前的主机虚拟机IP设置一样),结果悲剧就发生了,发现新开的虚拟机破坏了原来设置的IP环境,使用ifconfig发现原来的IP失效了。所以又去重新设置了下原来虚拟机的静态IP。
cd /etc/sysconfig/network-scripts
vi ifcfg-ens33(机器名字会有差异)
但是,设置完静态IP后,使用命令重启网卡服务,以为大功告成,结果报错如下:
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details
二 解决方案
重新设置虚拟机网卡
[root@localhost ~]# systemctl stop NetworkManager
[root@localhost ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager-wait-onl
ine.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
[root@localhost ~]# systemctl restart network
[root@localhost ~]#
[root@localhost ~]# service network restart
Restarting network (via systemctl): [ OK ]
[root@localhost ~]#
三 结果:
bug顺利被解决。
四 经验总结:
在使用vmware设置好多台虚拟机集群后,不要轻易在去开启新的虚拟机,这样可能会造成IP发生冲突,又要多花时间去重置。