Kafka:ZK+Kafka+Spark Streaming集群环境搭建(十二)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网。,Kafka:ZK+Kafka+Spark Streaming集群环境搭建(一)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网。》

Centos7出现异常:Failed to start LSB: Bring up/down networking.

按照《Kafka:ZK+Kafka+Spark Streaming集群环境搭建(一)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网。》配置好虚拟机,正在使用中,让它强制断电后,启动起来发现ip无法访问,而且重启网络失败:

执行:systemctl restart network.service
出现异常:Failed to start LSB: Bring up/down networking.

执行ifconfig,发现配置好的ens33也不见了:

[spark@master ~]$ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 336 (336.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 336 (336.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

解决方案:

systemctl stop NetworkManager systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

重新启动网络:

systemctl start network.service

重新ifconfig查看是否ens33启用

[root@master spark]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.120  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe71:ac74  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:71:ac:74  txqueuelen 1000  (Ethernet)
        RX packets 235  bytes 28303 (27.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137  bytes 22067 (21.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 336 (336.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 336 (336.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@master spark]# 

到此ens33起作用了,此时测试网络也可以通了。

 

    原文作者:spark
    原文地址: https://www.cnblogs.com/yy3b2007com/p/9280526.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞