Docker list bridge addresses failed: no available network 、 Error creating default "bridge" network 问题解决

K8S集群机器重启后,docker 启动失败,通过journalctl -xe 查看发现报错"list bridge addresses failed: no available network" 或者 Error starting daemon: Error initializing network controller: Error creating default "bridge" network: bridge has no IPv4 address configured

解决方法

先停止docker,kubelet也可以先停掉:

systemctl stop kubelet.service 
systemctl status docker.service

然后清理docker的network,可以先清理 /var/lib/docker/network/

rm -r -f /var/lib/docker/network/

如果不行再清理/var/lib/docker

mv /var/lib/docker /var/lib/docker-bak
  • 删除docker0和docker_gwbridge 网络
ifconfig docker0 down
brctl delbr docker0
ifconfig docker_gwbridge down
brctl delbr docker_gwbridge 

重启docker即可:

systemctl restart docker.service

验证:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-03-31 19:25:55 CST; 5min ago
     Docs: http://docs.docker.io
  Process: 14395 ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT (code=exited, status=0/SUCCESS)
 Main PID: 14394 (dockerd)
   Memory: 43.4M
   CGroup: /system.slice/docker.service
           ├─14394 /opt/kube/bin/dockerd
           └─14408 docker-containerd --config /var/run/docker/containerd/containerd.toml

Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.images"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.leases"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.namespaces"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.snapshots"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.tasks"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.version"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="loading plugin "io.containerd.grpc.v1.introspection"..." type=io.containerd.grpc.v1
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd-debug.sock"
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg=serving... address="/var/run/docker/containerd/docker-containerd.sock"
Mar 31 19:25:55 docker86-21 dockerd[14394]: time="2020-03-31T19:25:55+08:00" level=info msg="containerd successfully booted in 0.132473s"

posted @ 2020-03-31 19:32  JadePeng  阅读(1415)  评论(0编辑  收藏  举报