dockersamples/docker-swarm-visualizer

Service created but not assigned

Closed this issue · 4 comments

Hi,

Thanks for your application, I want to use it but I have a problem.
I have 3 master and 3 worker nodes. Master node Availabilities Drain (because I don't want to use them)

10.0.0.2:~$ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
0xd9pv31tstr04e2et2a8hyue swarm-manager1 Ready Drain Reachable
54nly90kgy765kcbijytrtvie swarm-node3 Ready Active
65is5lrerk5vg0eobhq6tyra7 swarm-node2 Ready Active
786oitrqobh69hfohr4bipxi8 swarm-manager3 Ready Drain Reachable
7x9e95ii8wrx9vtttqcvyzzvo * swarm-manager2 Ready Drain Leader
btgkcecu5tdoxd81jn3b0kv5d swarm-node1 Ready Active

That is command for run
DOCKER_HOST=10.0.0.2:2375 docker service create --name=viz --publish=5000:8080/tcp --constraint=node.role==manager --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --env HOST=10.0.0.2 manomarks/visualizer

But service waiting for assign.

10.0.0.2:~$ docker service ls
ID NAME REPLICAS IMAGE COMMAND
35ix70f64x7i viz 0/1 manomarks/visualizer

Is there anything missed?

@mustafayildirim this looks like an issue with engine, not with the visualizer. Have you tried it with other services (redis or something)? If you're having a general issue with Swarm Mode, you should submit the issue on https://github.com/docker/docker. If it's an issue only with this application, try to run the app with docker run instead, it doesn't need to be part of the swarm. If that works, then we may have an issue with this app. Also try manomarks/visualizer:beta

Master node Availabilities Drain (because I don't want to use them)

@mustafayildirim you can't schedule a service to nodes that are set to "drain" via swarm. Your constraint for the service is a manager via --constraint=node.role==manager, but all your managers are set to "drain" for the reason you mentioned in your initial report. This explains why your service is waiting to be assigned. If you set one of the managers back to available I bet the service would be schedule to that particular node. Your option if you want to schedule the visualizer via swarm vs running it docker run would be to set constraints on all your other services to only run on worker nodes and leave all nodes managers and workers to ready. I personally would recommend just run it on a particular manager using docker run as @ManoMarks suggested.

@ManoMarks @beenanner thanks your answer, I suspected with same you. You may be right that because managers are drain mode. I tried other applications but all is same not assigned.
I am closing the issue.

I fixed the problem. The problem is drain mode.
Thanks guys