Tag Archives: Cluster problem

The most complete solution for service network restart failure under CENTOS 7

Often, after changing the static IP under centOS 7, someone would find that the network service could not be restarted, so they searched the network, tried various methods and finally solved the problem.
is now a summary of various solutions, I hope to let you walk less crooked road.

First things first:
After executing the Service Network Restart command, the following error occurs:

Restarting network (via systemctl): Job for network. Service failed because the control process exited with error code.
See “systemctl status network. Service” and “journalctl-xe” for details.

After input systemctl status network. Service command, the following error message appears:

network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since 三 2018-09-05 13:01:47 CST; 1min 16s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4681 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/network.service
           └─1192 /sbin/dhclient -H mini1 -1 -q -lf /var/lib/dhclient/dhclient--ens33.lease -pf /v...
9月 05 13:01:47 mini1 network[4681]: RTNETLINK answers: File exists
9月 05 13:01:47 mini1 network[4681]: RTNETLINK answers: File exists
9月 05 13:01:47 mini1 network[4681]: RTNETLINK answers: File exists
9月 05 13:01:47 mini1 network[4681]: RTNETLINK answers: File exists
9月 05 13:01:47 mini1 network[4681]: RTNETLINK answers: File exists
9月 05 13:01:47 mini1 network[4681]: RTNETLINK answers: File exists
9月 05 13:01:47 mini1 systemd[1]: network.service: control process exited, code=exited status=1
9月 05 13:01:47 mini1 systemd[1]: Failed to start LSB: Bring up/down networking.
9月 05 13:01:47 mini1 systemd[1]: Unit network.service entered failed state.
9月 05 13:01:47 mini1 systemd[1]: network.service failed.

The network service cannot be started!! First of all, make sure that ifCFg-XXX (each machine is not the same) in /etc/sysconfig/network-scripts directory is free of errors (if you have made any changes), which refer to things like typing the wrong letters by hand during the change process.
The most common methods on the Internet are as follows:
1, and the NetworkManager service conflict, directly close the NetworkManager service, service NetworkManager stop, and forbid starting chkconfig NetworkManager off, finally restart it.
2. If it does not match the MAC address of the configuration file, use IP ADDR (or IFconfig) to check the MAC address

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:b8:e7:21 brd ff:ff:ff:ff:ff:ff
    inet 192.168.65.141/24 brd 192.168.65.255 scope global dynamic ens33
       valid_lft 1193sec preferred_lft 1193sec
    inet6 fe80::cca2:d835:f93:e637/64 scope link 
       valid_lft forever preferred_lft forever

00:0 C :29:b8:e7:21 is the MAC address, change HWADDR in /etc/sysconfig/ net-scripts/ifCFg-XXX to this MAC address
3. Set up and start a service named networkmanager-waiting-online . The command is: systemctl enable networkmanager-waiting-online-service
4, see /etc/sysconfig/network - scripts , will the rest of the network card position papers all deleted, avoid unnecessary influence, is only a file, starting with ifcfg leave that one should use IP addr command to check the IP the second identical at the beginning of (see above for my ens33, I posted the IP addr command execution results), so I only left a ifcfg - ens33. (That's how two of my machines worked, because I made a backup before changing it, so just delete it...)
5. Comment out the DEVICE line in IFCFG-XXX file.
6. Change the NAME in IFCFG-XXX to be the same as the file NAME.
7. Change the network mode to bridge in VMWare edit-Virtual Network Editor.
8. Check whether the network adapter at the bottom right corner of VMWare is connected or not. If it is not connected, it will be connected.

(note: click the network adapter - Settings, and try to change the NAT mode to bridge. After I changed the bridge mode, I could restart the network service, but I could not connect to the network. After restarting,
and then change the bridge mode to NAT mode, and I found that I could both surf the Internet and restart the network service.)
9. Check to see if VMware DHCP Service and VMware NAT Service are disabled on your computer. If so, turn them on.
10. If you change to static IP don't forget to change BOOTPROTO to static.
11,, if the above is not resolved, there is a final move - restart to see if there is a miracle!! (A lot of times you just restart it.)
I have tried almost all of the above methods, some of which are useful or not useful for my machine, but some people have solved them with these methods, and recorded them together for future use