Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

docker-machine --swarm-discovery with token does not seem to work? #3788

Closed
pc-mreeves opened this issue Sep 27, 2016 · 4 comments
Closed

docker-machine --swarm-discovery with token does not seem to work? #3788

pc-mreeves opened this issue Sep 27, 2016 · 4 comments

Comments

@pc-mreeves
Copy link

What I an trying to do is have both docker manager and docker workers have a pre-selected token they can use so I don't need to docker ssh and run further commands. The docs seem to support that process with the --swarm-discovery flag with a token.

docker run swarm create

Use that token below in the next command:

docker-machine create --swarm-master --swarm --driver virtualbox --swarm-discovery token://b4e72945cb52c1324REDACTED manager2

  1. I can run docker-machine ssh but when I run docker node ls it says 'This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.' and then I need to run docker swarm init.
    However, looking at processes I see this:
    /swarm manage --tlsverify --tlscacert=/var/lib/boot2docker/ca.pem --tlscert=/var/lib/boot2docker/server.pem --tlskey=/var/lib/boot2docker/server-key.pem -H tcp://0.0.0.0:3376 --strategy spread --advertise 192.168.99.100:3376 token://b4e72945cb52c1324REDACTED
  2. The same issue happens when I try to run docker-machine create --swarm --driver virtualbox --swarm-discovery "token://b4e72945cb52c1324REDACTED" worker1 in that it does not automatically join the swarm... I have to ssh and run docker join.

Thus, I don't see the point of the --swarm-discovery flag using the token protocol.

$ docker -v
Docker version 1.12.1, build 6f9534c

$ docker-machine -v
docker-machine version 0.8.1, build 41b3b25
@pc-mreeves
Copy link
Author

@ahmetalpbalkan - I think perhaps this is a fix for a different issue?

@ahmetb
Copy link
Contributor

ahmetb commented Sep 27, 2016

@pc-mreeves yep my mistake

@nathanleclaire
Copy link
Contributor

You are mixing "classic swarm" (https://github.com/docker/swarm) and "swarm mode" (introduced in 1.12 and bundled into the engine).

To use "classic swarm" you do eval $(docker-machine env --swarm manager). If you want to use the new swarm mode features you have to run init and join commands on the vbox nodes yourself -- thanks

@zhoulouzi
Copy link

@nathanleclaire It took me a long time to find out how to config a swarm mode in using docker-machine. It doesn't seem necessary because the new mode is simple enough thanks your comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants