Docker node statuses

Hi. In a Docker Swarm cluster, nodes are usually in status=Ready:

ID                        HOSTNAME  STATUS  AVAILABILITY    MANAGER STATUS
2kog6n57gopo8xc920lmxkr9v *   moby  Ready   Active          Leader

However, I’ve also seen nodes in status ‘Down’ and ‘Unknown’.
My questions are:

  1. Is there a list of possible node statuses? I’ve not found it in the official docs.
  2. Can I safely remove nodes in “Down” and “Unknown” status or are those nodes recoverable somehow?

Thank you!

Hi there!
I’ll try to answer your first question. I couldn’t find a list in the docs, but exploring the engine’s source code (https://github.com/docker/engine-api/blob/master/types/swarm/node.go) the possible values are: ready, down, disconnected and unknown.

Cheers!

Hi again!
about your second question.

A node can only be removed from a Swarm if it’s in the Down state so… sure it would be safe to remove them as no task will be running on them. A node in the Unknown state could mean that it never got added to the Swarm so it would be safe to remove it too.

Your question about it those nodes are recoverable. Well, a node is considered to be down either if it can be reachable because there is a network issue or because it was powered off / shutted down. If it’s a network issue you may recover those nodes, if it’s a token issue you may have to try to rejoin them to the swarm.

Cheers!