follow-me-install-kubernetes-cluster icon indicating copy to clipboard operation
follow-me-install-kubernetes-cluster copied to clipboard

您好,部署flannel的时候报了这个错Watch subnets: failed to retrieve subnet leases: context canceled,网上也查不到相关的解决办法

Open fcy1992 opened this issue 7 years ago • 5 comments

Sep 20 19:44:43 localhost.localdomain systemd[1]: flanneld.service stop-sigterm timed out. Killing. Sep 20 19:44:43 localhost.localdomain systemd[1]: flanneld.service: main process exited, code=killed, status=9/KILL Sep 20 19:44:43 localhost.localdomain systemd[1]: Failed to start Flanneld overlay address etcd agent. -- Subject: Unit flanneld.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit flanneld.service has failed.

-- The result is failed. Sep 20 19:44:43 localhost.localdomain systemd[1]: Unit flanneld.service entered failed state. Sep 20 19:44:43 localhost.localdomain systemd[1]: flanneld.service failed. Sep 20 19:44:43 localhost.localdomain systemd[1]: flanneld.service holdoff time over, scheduling restart. Sep 20 19:44:43 localhost.localdomain systemd[1]: Starting Flanneld overlay address etcd agent... -- Subject: Unit flanneld.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit flanneld.service has begun starting up. Sep 20 19:44:43 localhost.localdomain flanneld[2232]: warning: ignoring ServerName for user-provided CA for backwards compatibility is deprecated Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.499340 2232 main.go:132] Installing signal handlers Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.499748 2232 manager.go:136] Determining IP address of default interface Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.500108 2232 manager.go:149] Using interface with name ens33 and address 192.168.20.177 Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.500128 2232 manager.go:166] Defaulting external address to interface address (192.168.20.177) Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.559420 2232 local_manager.go:134] Found lease (172.30.9.0/24) for current IP (192.168.20.177), reusing Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.562372 2232 manager.go:250] Lease acquired: 172.30.9.0/24 Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.562657 2232 network.go:58] Watching for L3 misses Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.562668 2232 network.go:66] Watching for new subnet leases Sep 20 19:44:43 localhost.localdomain systemd[1]: flanneld.service: control process exited, code=exited status=203 Sep 20 19:44:43 localhost.localdomain flanneld[2232]: I0920 19:44:43.567916 2232 main.go:172] Exiting... Sep 20 19:44:43 localhost.localdomain flanneld[2232]: E0920 19:44:43.567976 2232 watch.go:43] Watch subnets: failed to retrieve subnet leases: context canceled Sep 20 19:44:44 localhost.localdomain flanneld[2232]: E0920 19:44:44.570061 2232 watch.go:43] Watch subnets: failed to retrieve subnet leases: context canceled Sep 20 19:44:45 localhost.localdomain flanneld[2232]: E0920 19:44:45.571268 2232 watch.go:43] Watch subnets: failed to retrieve subnet leases: context canceled

fcy1992 avatar Sep 20 '17 03:09 fcy1992

看起来是网络超时引起的。

192.168.20.177 是你的缺省路由所在的网络接口地址么?

opsnull avatar Sep 22 '17 05:09 opsnull

我也遇到了这样的问题,后来发现flanneld.service中mk-docker-opts.sh的路径写错了,改正后重启竟然就解决这个问题了,我看mk-docker-opts.sh脚本并没有太多内容,只是很简单的生成Docker相关变量而已,虽然不太搭边,但你可以作为参考检查一下。

xulis avatar Mar 08 '18 03:03 xulis

flanneld.service export IFACE=eth0 等于你的 网卡名称

guoyiwen avatar Dec 27 '18 06:12 guoyiwen

可以同步一下 各个节点的时钟试试 我也遇到了 同步一下时钟就好了。

albertzhang01 avatar Sep 09 '20 04:09 albertzhang01

我遇到这个是因为mk-docker-opts.sh被写入了^M导致的

Queetinliu avatar Sep 06 '21 09:09 Queetinliu