美文网首页
arm架构启动flannel网络时报错

arm架构启动flannel网络时报错

作者: 风吹路过的云 | 来源:发表于2023-04-08 00:00 被阅读0次

之前一直用的x86架构,现在转为arm架构,在安装启动flannel网络时,遇到一些小问题,在这里记录一下,具体的安装过程,就不重复了,网上有好多相关的。
systemctl start flanneld
启动就报了一个错误

[root@11 ~]# systemctl start flanneld
Job for flanneld.service failed because the control process exited with error code.
See "systemctl status flanneld.service" and "journalctl -xe" for details.
[root@11 ~]# journalctl -xe
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.588177   31136 main.go:211] CLI flags config: {etcdEndpoints:http://192.168.0.224:2379 etcdPrefix:/coreos.com/network etcdKey>
Apr 08 22:53:49 docker01 flanneld-start[31136]: W0408 22:53:49.588296   31136 main.go:630] no subnet found for key: FLANNEL_IPV6_SUBNET in file: /run/flannel/subnet.env
Apr 08 22:53:49 docker01 flanneld-start[31136]: W0408 22:53:49.588334   31136 registry.go:84] no certificate provided: connecting to etcd with http. This is insecure
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.588709   31136 main.go:231] Created subnet manager: Etcd Local Manager with Previous Subnet: 10.0.4.0/24
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.588733   31136 main.go:234] Installing signal handlers
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.591121   31136 main.go:542] Found network config - Backend type: udp
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.591157   31136 match.go:206] Determining IP address of default interface
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.591399   31136 match.go:259] Using interface with name eth0 and address 192.168.0.252
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.591422   31136 match.go:281] Defaulting external address to interface address (192.168.0.252)
Apr 08 22:53:49 docker01 flanneld-start[31136]: E0408 22:53:49.591446   31136 main.go:326] Error fetching backend: UDP backend is not supported on this architecture
Apr 08 22:53:49 docker01 flanneld-start[31136]: I0408 22:53:49.591504   31136 main.go:522] Stopping shutdownHandler...
Apr 08 22:53:49 docker01 systemd[1]: flanneld.service: Main process exited, code=exited, status=1/FAILURE
Apr 08 22:53:49 docker01 systemd[1]: flanneld.service: Failed with result 'exit-code'.
Apr 08 22:53:49 docker01 systemd[1]: Failed to start Flanneld overlay address etcd agent.
-- Subject: Unit flanneld.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Unit flanneld.service has failed.
-- 
-- The result is RESULT.
Apr 08 22:53:49 docker01 systemd[1]: flanneld.service: Service RestartSec=100ms expired, scheduling restart.
Apr 08 22:53:49 docker01 systemd[1]: flanneld.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Automatic restarting of the unit flanneld.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Apr 08 22:53:49 docker01 systemd[1]: Stopped Flanneld overlay address etcd agent.
-- Subject: Unit flanneld.service has finished shutting down
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Unit flanneld.service has finished shutting down.
Apr 08 22:53:49 docker01 systemd[1]: flanneld.service: Start request repeated too quickly.
Apr 08 22:53:49 docker01 systemd[1]: flanneld.service: Failed with result 'exit-code'.
Apr 08 22:53:49 docker01 systemd[1]: Failed to start Flanneld overlay address etcd agent.
-- Subject: Unit flanneld.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Unit flanneld.service has failed.
-- 
-- The result is RESULT.

意思是说,UDP模式在这arm架构不能跑。
flannel默认的后端模式就是UDP,既然默认的不行,那我们就改改它的模式,flannel后端模式有三种:UDP、vxlan和host-gw,
修改它的后端模式,要在etcd集群里用etcdctl命令进行修改

etcdctl put /coreos.com/network/config '{"Network":"10.0.0.0/16", "SubnetMin": "10.0.1.0", "SubnetMax": "10.0.20.0", "Backend": {"Type": "vxlan"}}'

一开始,我没有设置backend,是这样设的

etcdctl put /coreos.com/network/config '{"Network":"10.0.0.0/16", "SubnetMin": "10.0.1.0", "SubnetMax": "10.0.20.0"}'

好了,设置完后,再次启动flannel就可以了。
下面的这些链接,有对flannel的工作原理有详细的讲解,同学们自行研读。

相关链接:
https://www.cnblogs.com/huiyichanmian/p/15767418.html
https://juejin.cn/post/6994825163757846565
https://code84.com/234492.html
https://www.linuxprobe.com/flannel.html
https://www.shuzhiduo.com/A/KE5QjVWkdL/
https://blog.csdn.net/LSY_CSDN_/article/details/120272835
https://github.com/flannel-io/flannel/issues/1221

相关文章

网友评论

      本文标题:arm架构启动flannel网络时报错

      本文链接:https://www.haomeiwen.com/subject/reumddtx.html