0

I've got a Docker Swarm Stack. Three managers and two nodes, precisely. There're few services on one node (on that node only) which are working correctly, and I've got a zombie container on it, which couldn't be killed. I wanted to drain this node to prevent access to this "bad" container (which is working, just ain't responding to any command, it's a website container) and create a healthy one later. And I'm not sure if these services would be rearranged to the "healthy" node?

Presumably, docker system prune hasn't finished its work correctly, and now the system is in lock mode.

I'm using Moby Linux.

$ docker version
Client:
 Version:   17.12.0-ce
 API version:   1.35
 Go version:    go1.9.2
 Git commit:    c97c6d6
 Built: Wed Dec 27 20:05:03 2017
 OS/Arch:   linux/amd64

Server:
 Engine:
  Version:  17.12.0-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.2
  Git commit:   c97c6d6
  Built:    Wed Dec 27 20:12:30 2017
  OS/Arch:  linux/amd64
  Experimental: true

UDP1: draining a node doesn't stop any containers or rearranges the services, at least not from the start. Basically, all services on that node continue to functioning. That's was the question of interest.

UPD2: after rebooting it started to give errors about 'No such image was found...', it could be resolved by logging in to Docker hub again.

Ronar
  • 7
  • 3

1 Answers1

0

it's the principle of swarm, same Kubernetes, if a nodes goes down, as long as a master exists it should rearrange the distribution of all container to the other nodes.

night-gold
  • 2,202
  • 2
  • 20
  • 31
  • Thank you for the reply and I'm almost sorry to answer after such a long time. Yes, it makes sense, but the question was about the particular command's behaviour (i.e. draining the node). After rebooting the instance the Swarm rearranged services to other nodes, although the node stayed clear (only after recreating the service it was arranged some tasks). – Ronar Oct 15 '18 at 13:11
  • It wasn't very clear in the first post, is this what you are looking for? https://docs.docker.com/engine/swarm/swarm-tutorial/drain-node/ – night-gold Oct 15 '18 at 21:10
  • yeah, I agree, maybe not very clear. And yes, I've seen that article. That's was the main source for this command. I mean the doc itself isn't very clear. So that's why I needed some clarification. I was very limited in time and resources, and managing the Swarm is not my main responsibility. I wanted to make sure everything will go smoothly. But okay I'll accept your answer, thanks again, anyway. – Ronar Oct 17 '18 at 09:59
  • it sounds like you want to rebalance the services on all nodes. You can find out how in the answer here: https://stackoverflow.com/questions/49518376/docker-swarm-how-to-balance-already-running-containers-in-a-swarm-cluster – Leo Lei Jul 23 '19 at 07:24