问题描述
OpenStack 版本:训练 操作系统:CentOS7
你好,
- 我正在尝试使用 openstack magnum 部署 docker swarm。
- 实例已创建,但无法使用 docker 命令部署容器。
- 当我检查实例时,Flannel 和 etcd 似乎无法正常工作。
- 如何让 Flannel 运行?
详情:
我无法在 Openstack 上部署 swarm-cluster。 当我请求创建集群时,会创建 swarm 集群。 但问题是当我部署容器时,它不起作用。 (我遵循 OpenStack 官方指南 - 使用 Magnum 启动实例 网站:https://docs.openstack.org/magnum/latest/install/launch-instance.html)
[root@controller ~]# $(openstack coe cluster config swarm --dir myclusterconfig)
[root@controller ~]# docker ps
Cannot connect to the Docker daemon at tcp://(swarm floating IP):2376. Is the docker daemon running?
所以当我检查主实例时,有一些问题。
当我使用 journalctl -xe 命令检查状态时 结果如下。
cloud-init[1373]: Can't open user config file /srv/magnum/.ssh/config: No such file or directory
和其他问题是法兰绒服务不工作
(实际上,在官方 openstack magnum 指南中,它说使用 fedora-atomic-image 27 版本。在版本 27 中,删除了 flannel 和 etcd,因此使用版本 26。)
[root@swarm-eexwqnhya3f6-master-0 ~]# systemctl status flanneld
● flanneld.service - Flanneld overlay address etcd agent
Loaded: loaded (/usr/lib/systemd/system/flanneld.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/flanneld.service.d
└─flannel-docker-bridge.conf
Active: activating (start) since Fri 2021-06-25 09:39:08 UTC; 48s ago
Main PID: 5858 (flanneld)
Tasks: 7 (limit: 4915)
Memory: 4.9M
cpu: 59ms
CGroup: /system.slice/flanneld.service
└─5858 /usr/bin/flanneld -etcd-endpoints=http://127.0.0.1:2379 -etcd-prefix=/atomic.io/network
Jun 25 09:39:47 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:47.559693 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:48 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:48.561497 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:49 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:49.563460 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:50 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:50.565263 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:51 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:51.567032 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:52 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:52.568903 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:53 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:53.570770 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:54 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:54.572529 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:55 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:55.574486 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
Jun 25 09:39:56 swarm-eexwqnhya3f6-master-0.novalocal flanneld[5858]: E0625 09:39:56.577890 5858 network.go:102] Failed to retrieve network config: 100: Key not found (/atomic.io) [3]
etcd 服务正在运行,但 flannel 服务未运行。
● etcd.service - Etcd Server
Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2021-06-25 09:16:33 UTC; 29min ago
Main PID: 1426 (etcd)
Tasks: 7 (limit: 4915)
Memory: 21.1M
cpu: 7.216s
CGroup: /system.slice/etcd.service
└─1426 /usr/bin/etcd --name=10.0.0.41 --data-dir=/var/lib/etcd/default.etcd --listen-client-urls=http://10.0.0.41:2379,http://127.0.0.1:2379
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: raft.node: cf837ecc74959a40 elected leader cf837ecc74959a40 at term 2
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: setting up the initial cluster version to 3.1
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: published {Name:10.0.0.41 ClientURLs:[http://10.0.0.41:2379 http://127.0.0.1:2379]} to cluster 4c215
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: ready to serve client requests
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: serving insecure client requests on 10.0.0.41:2379,this is strongly discouraged!
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: ready to serve client requests
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: serving insecure client requests on 127.0.0.1:2379,this is strongly discouraged!
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal systemd[1]: Started Etcd Server.
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: set the initial cluster version to 3.1
Jun 25 09:16:33 swarm-eexwqnhya3f6-master-0.novalocal etcd[1426]: enabled capabilities for version 3.1
~
有人说,检查etcd命令,但是etcdctl命令也有如下问题。
[root@swarm-eexwqnhya3f6-master-0 ~]# etcdctl get /atomic./network/config
Error: 100: Key not found (/atomic.) [3]
我认为 docker 没有正常运行的原因是 flannel 服务没有运行。有谁知道为什么它不起作用?
请帮助我,我已经为此苦苦挣扎了几个月。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)