0

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)

overexchange
  • 15,768
  • 30
  • 152
  • 347
  • There are 5 replicas split among 5 instances - if you run a 6th it might be scheduled to your `mgr3` (e.g. it has no task to run at the moment if I'm not mistaken). – masseyb Aug 30 '19 at 22:55
  • @masseyb can the user connect to `mg3` public ip and get the service? despite the task is not running on `mgr3`.... this is my question – overexchange Aug 30 '19 at 22:59
  • @masseyb Related question https://stackoverflow.com/q/57733989/3317808 – overexchange Aug 30 '19 at 23:10
  • @overexchange - A swarm manager nodes handles cluster management tasks such as: - maintaining cluster state - scheduling services - serving swarm mode HTTP API endpoints You may execute any of the - docker swarm * - docker node * - docker service * from any of the manager nodes – Sujay Pillai Sep 02 '19 at 10:49

1 Answers1

0

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.

masseyb
  • 3,745
  • 1
  • 17
  • 29
  • my question is... service is not installed on `mgr3`... but still... does the service(`docker service`) be available from `mgr3`? – overexchange Aug 30 '19 at 23:24