docker之docker容器flannel模式多网段跨主机-创新互联

问题一:docker无法启动
错误提示:
[root@localhost docker.service.d]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: error (Reason: Invalid argument)
Drop-In: /usr/lib/systemd/system/docker.service.d
└─flannel.conf
Active: failed (Result: start-limit) since Fri 2020-01-17 01:18:59 PST; 4min 57s ago
Docs: https://docs.docker.com
Main PID: 9775 (code=exited, status=1/FAILURE)

成都创新互联从2013年创立,我们提供高端网站建设、微信平台小程序开发、电商视觉设计、App定制开发及网络营销搜索优化服务,在传统互联网与移动互联网发展的背景下,我们坚守着用标准的设计方案与技术开发实力作基础,以企业及品牌的互联网商业目标为核心,为客户打造具商业价值与用户体验的互联网+产品。

Jan 17 01:18:56 localhost.localdomain systemd[1]: docker.service failed.
Jan 17 01:18:59 localhost.localdomain systemd[1]: docker.service holdoff time over, scheduling restart.
Jan 17 01:18:59 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
Jan 17 01:18:59 localhost.localdomain systemd[1]: start request repeated too quickly for docker.service
Jan 17 01:18:59 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Jan 17 01:18:59 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Jan 17 01:18:59 localhost.localdomain systemd[1]: docker.service failed.
Jan 17 01:20:37 localhost.localdomain systemd[1]: docker.service has more than one ExecStart= setting, wh...ing.
Jan 17 01:21:34 localhost.localdomain systemd[1]: docker.service has more than one ExecStart= setting, wh...ing.
Jan 17 01:23:46 localhost.localdomain systemd[1]: docker.service has more than one ExecStart= setting, wh...ing.
Hint: Some lines were ellipsized, use -l to show in full.
docker之docker容器flannel模式多网段跨主机
解决:
升级内核:
[root@localhost docker.service.d]# yum update -y
升级完成后,卸载旧版本,重新安装docker-ce。
[root@localhost docker.service.d]# rpm -qa |grep docker-ce
docker-ce-19.03.5-3.el7.x86_64
docker-ce-cli-19.03.5-3.el7.x86_64
[root@localhost docker.service.d]# rpm -e --nodeps docker-ce-19.03.5-3.el7.x86_64
[root@localhost docker.service.d]# rpm -e --nodeps docker-ce-cli-19.03.5-3.el7.x86_64
[root@localhost docker.service.d]# yum install -y docker-ce-*

[root@localhost docker.service.d]# systemctl start docker

[root@localhost docker.service.d]# systemctl status docker
docker之docker容器flannel模式多网段跨主机
docker正常启动!!!!
反思:是否可以先安装flannel,再按照docker-ce,是否会出现类似的情况?待测试!!!!

问题二:docker、flannel正常启动,但docker0无法获取地址池地址。
docker之docker容器flannel模式多网段跨主机
解决:
修改/usr/lib/systemd/system/docker.service文件
[root@localhost docker.service.d]# vim /usr/lib/systemd/system/docker.service
添加以下内容:
在ExecStart=/usr/bin/dockerd后添加$DOCKER_NETWORK_OPTIONS
在[server]最后添加
EnvironmentFile=/run/flannel/docker
docker之docker容器flannel模式多网段跨主机
重新启动docker
[root@localhost docker.service.d]# systemctl daemon-reload
[root@localhost docker.service.d]# systemctl restart docker.service
[root@localhost docker.service.d]# ifconfig
docker之docker容器flannel模式多网段跨主机
docker0正常获取flannel地址池。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页标题:docker之docker容器flannel模式多网段跨主机-创新互联
本文URL:http://myzitong.com/article/ephgi.html