之前一直用的x86架構(gòu)舶担,現(xiàn)在轉(zhuǎn)為arm架構(gòu)坡疼,在安裝啟動(dòng)flannel網(wǎng)絡(luò)時(shí),遇到一些小問題衣陶,在這里記錄一下柄瑰,具體的安裝過程,就不重復(fù)了剪况,網(wǎng)上有好多相關(guān)的教沾。
systemctl start flanneld
啟動(dòng)就報(bào)了一個(gè)錯(cuò)誤
[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架構(gòu)不能跑拯欧。
flannel默認(rèn)的后端模式就是UDP详囤,既然默認(rèn)的不行,那我們就改改它的模式,flannel后端模式有三種:UDP藏姐、vxlan和host-gw隆箩,
修改它的后端模式,要在etcd集群里用etcdctl命令進(jìn)行修改
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"}}'
一開始羔杨,我沒有設(shè)置backend捌臊,是這樣設(shè)的
etcdctl put /coreos.com/network/config '{"Network":"10.0.0.0/16", "SubnetMin": "10.0.1.0", "SubnetMax": "10.0.20.0"}'
好了,設(shè)置完后兜材,再次啟動(dòng)flannel就可以了理澎。
下面的這些鏈接,有對flannel的工作原理有詳細(xì)的講解曙寡,同學(xué)們自行研讀糠爬。
相關(guān)鏈接:
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