Is docker swarm a container aware load balancer?

China☆狼群 提交于 2019-12-11 16:45:39

问题


6 node docker swarm(cluster) - 3 mgrs, 3 workers

After running below command:

     docker service create --name psight -p 8080:8080 --replicas 5 <image>

We see that, mgr3 does not run the task(shown below)

$ docker service ps psight1                                                                          
ID   NAME     IMAGE   NODE   DESIRED_STATE   CURRENT_STATE     ERROR        PORTS                                                        
yoj  psight.1  image   wrk2      Running    Running 19 minutes ago                                                                                    
sjb  psight.2  image   wrk3      Running    Running 19 minutes ago                                                                                    
vv6  psight.3  image   mgr1      Running    Running 19 minutes ago                                                                                    
scf  psight.4  image   mgr2      Running    Running 19 minutes ago                                                                                    
7i2  psight.5  image   wrk1      Running    Running 19 minutes ago 

but,

Can service be available from mgr3? with actual state(above)


回答1:


As long as the mgr3 is reachable as a manager (ref. Monitor swarm health) then it should be able to perform the usual tasks of a manager.

If your instances are expose on the wide area network with a public IP, with ssh open to the world (e.g. 0.0.0.0/0, ::/0) and that you have you ssh key then you should be able to connect to the instance.



来源:https://stackoverflow.com/questions/57733682/is-docker-swarm-a-container-aware-load-balancer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!