2018-03-07 Ubuntu 16.04.3 LTS网络无

2018-03-07  本文已影响0人  HuluEric

系统版本:Ubuntu 16.04.3
Docker 版本:

Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64
 Experimental: false

故障现象:
系统启动时无法启动网卡,查看系统日志syslog

vim /var/log/syslog

查阅最近日志为如下报错:

Mar  7 05:55:43 ubuntu ifup[11076]: /usr/sbin/fanctl: 41: /usr/sbin/fanctl: arithmetic expression: expecting primary: " (32-)/4 "
Mar  7 05:55:43 ubuntu ifup[11076]: run-parts: /etc/network/if-up.d/ubuntu-fan exited with return code 2
Mar  7 05:55:43 ubuntu ifup[11076]: Failed to bring up ens33.
Mar  7 05:55:43 ubuntu systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Mar  7 05:55:43 ubuntu systemd[1]: Failed to start Raise network interfaces.
Mar  7 05:55:43 ubuntu systemd[1]: networking.service: Unit entered failed state.
Mar  7 05:55:43 ubuntu systemd[1]: networking.service: Failed with result 'exit-code'.
Mar  7 05:55:51 ubuntu kernel: [  620.320661] br-0e632461aeeb: port 1(vethebb3048) entered forwarding state
Mar  7 05:55:52 ubuntu kernel: [  621.852494] br-d8bfabba8ab9: port 1(vethb04d92d) entered forwarding state
Mar  7 05:55:56 ubuntu kernel: [  625.558751] br-0e632461aeeb: port 1(vethebb3048) entered disabled state
Mar  7 05:55:56 ubuntu kernel: [  625.558824] vethfcf399e: renamed from eth0
Mar  7 05:55:56 ubuntu kernel: [  625.600788] br-0e632461aeeb: port 1(vethebb3048) entered disabled state
Mar  7 05:55:56 ubuntu kernel: [  625.601585] device vethebb3048 left promiscuous mode
Mar  7 05:55:56 ubuntu kernel: [  625.601587] br-0e632461aeeb: port 1(vethebb3048) entered disabled state
Mar  7 05:55:58 ubuntu dockerd[1139]: time="2018-03-07T05:55:58.862564669-08:00" level=warning msg="Couldn't run auplink before unmount /var/lib/docker/aufs/mnt/543cc298f778d7b0f6bffeb8f92472cfa370d6a0e7f44faf7469d99987917703: exec: \"auplink\": executable file not found in $PATH"

其中核心错误码为:

Mar  7 05:55:43 ubuntu ifup[11076]: /usr/sbin/fanctl: 41: /usr/sbin/fanctl: arithmetic expression: expecting primary: " (32-)/4 "

经放狗搜索,查阅到是ubuntu-fan组件的bug,具体bug讨论地址为:

https://bugs.launchpad.net/juju/+bug/1737640

解决办法:

  1. 下载安装最新版本
    下载网页为:https://ubuntu.pkgs.org/18.04/ubuntu-main-amd64/ubuntu-fan_0.12.9_all.deb.html
    下载地址为:http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-fan/ubuntu-fan_0.12.9_all.deb

  2. 将文件上传至服务器,通过光碟或其它形式

  3. 安装

dpkg -i ubuntu-fan_0.12.9_all.deb

出现以下情况为安装成功:

root@ubuntu:/usr/local/src# dpkg -i ubuntu-fan_0.12.9_all.deb
(Reading database ... 59324 files and directories currently installed.)
Preparing to unpack ubuntu-fan_0.12.9_all.deb ...
Unpacking ubuntu-fan (0.12.9) over (0.12.9) ...
Setting up ubuntu-fan (0.12.9) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for man-db (2.7.5-1) ...

重启网络服务

service networking restart

检查网络服务状态

service networking status
root@ubuntu:/usr/local/src# service networking restart
root@ubuntu:/usr/local/src# service networking status
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: active (exited) since Wed 2018-03-07 07:02:36 PST; 2s ago
     Docs: man:interfaces(5)
  Process: 7112 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCESS)
  Process: 7181 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
  Process: 7173 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=0/SUCCESS)
 Main PID: 7181 (code=exited, status=0/SUCCESS)
    Tasks: 1
   Memory: 1.0M
      CPU: 159ms
   CGroup: /system.slice/networking.service
           └─7223 /sbin/dhclient -1 -v -pf /run/dhclient.ens33.pid -lf /var/lib/dhcp/dhclient.ens33.leases -I -df /var/lib/dhcp/dhclient6.ens33.leases ens33

Mar 07 07:02:35 ubuntu dhclient[7191]: Sending on   Socket/fallback
Mar 07 07:02:35 ubuntu dhclient[7191]: DHCPDISCOVER on ens33 to 255.255.255.255 port 67 interval 3 (xid=0x8923375e)
Mar 07 07:02:36 ubuntu dhclient[7191]: DHCPREQUEST of 192.168.1.101 on ens33 to 255.255.255.255 port 67 (xid=0x5e372389)
Mar 07 07:02:36 ubuntu ifup[7181]: DHCPREQUEST of 192.168.1.101 on ens33 to 255.255.255.255 port 67 (xid=0x5e372389)
Mar 07 07:02:36 ubuntu ifup[7181]: DHCPOFFER of 192.168.1.101 from 192.168.1.1
Mar 07 07:02:36 ubuntu dhclient[7191]: DHCPOFFER of 192.168.1.101 from 192.168.1.1
Mar 07 07:02:36 ubuntu dhclient[7191]: DHCPACK of 192.168.1.101 from 192.168.1.1
Mar 07 07:02:36 ubuntu ifup[7181]: DHCPACK of 192.168.1.101 from 192.168.1.1
Mar 07 07:02:36 ubuntu ifup[7181]: bound to 192.168.1.101 -- renewal in 2945 seconds.
Mar 07 07:02:36 ubuntu systemd[1]: Started Raise network interfaces.

上一篇下一篇

猜你喜欢

热点阅读