..

8.docker网络 -- 相关问题

文档地址 ,相关视频

 

可能出现的问题:

1.subnet sandbox join failed for \"10.0.0.0/24\": error creating VXLAN interface: file exists

解决方案:参考这里1

笔记:

使用overlay网络的容器的vxlan生命周期:
(1)Create a VXLAN interface which uses the VXLAN id of the associated Docker network (docker network create --driver=overlay ...) - at this point the VXLAN interface is visible on the host(ip -d link show);
(2)Then dockerd puts the VXLAN interface into the namespace of the container - at this point the VXLAN interface is not visible anymore on the host;
(3)When the container stops, the device is given back to the host;
(4)The device is deleted by the dockerd;

也就是说某些情情况下vxlan并没有随着容器的停止(不知道是停止还是删除)而被释放(删除),导致后续启动容器的时候,无法创建vxlan导致容器无法启动。

ip -d link show | grep vx       #查看vxlan接口
ip link delete vx-00100f-drzik  #删除某个vxlan接口, vx-00100f-drzik只是一个示例,此处根据实际情况。

 

 

2.docker host间无法通信,lookup <my_docker_service_name> on 127.0.0.11:53: no such host

解决方案:参考这里1,

笔记:

根据docker官方文档,需要防火墙放行端口
TCP port 2377 for cluster management communications
TCP and UDP port 7946 for communication among nodes
UDP port 4789 for overlay network traffic

 

 

3.lookup <my_docker_service_name> on 127.0.0.11:53: no such host

解决方案:在相关端口放行的情况下,仍然有这个问题,我重启了一下docker host,其实应该先重启docker 服务试一下的。

 

 

4.dockekr swarm 的负载均衡影响别的节点的端口?
事实是:如果集群中一个节点的A端口被使用,那么集群中任意节点的A端口都能访问到这个端口上的服务。

 

 

 

5.

posted @ 2020-09-22 17:59  罗浩楠  阅读(1940)  评论(0)    收藏  举报
..