I'm a Docker swarm mode noob going through the tutorial at https://docs.docker.com/engine/swarm/swarm-tutorial and noticed when I hit the chapter on draining nodes (https://docs.docker.com/engine/swarm/swarm-tutorial/drain-node/) that both of my worker nodes were given the same name, moby
:
matthew@bunty:~$ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
3vkklry19mesmsjrgltj53kap moby Ready Active
biur2a68tze2oykta9klklkeq moby Ready Active
daf8npyma8r0dnmcxu6j491jq * bunty Ready Active Leader
That makes issuing the drain command fail:
matthew@bunty:~$ docker node update --availability drain moby
Error response from daemon: node moby is ambiguous (2 matches found)
If I use the ID, the command works.
I saw Docker swarm: How to manually set node names?, but my environment is different. My manager node is an Ubuntu box with hostname bunty
, and my workers are a Windows box with hostname VADER
& my MacBook Pro with hostname newt
. All are running the latest version of Docker 1.12.x.
I expected the node names to be bunty
, VADER
, & newt
, respectively, but instead I get bunty
for the manager & moby
for both workers.
What gives? There doesn't appear to be an option in the docker swarm join
command that lets me manually name the node, and each worker has a unique hostname.