Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the docker swarm token stored?

I've created a docker-machine swarm cluster using a new generated token, which was stored within an environment variable. The environment variable was only for valid for the current session, and is deleted afterward. Now I want to add a new docker-machine to the same cluster, but I can't find the needed token.

How is it possible to find out the token used by an active docker swarm ?

like image 968
Sabbane Avatar asked Oct 09 '15 09:10

Sabbane


1 Answers

Answering for posterity, since I had no luck with the other answer.

Running Docker 17.05. Docker can now list join tokens for both workers and managers.

$ docker swarm join-token manager

To add a manager to this swarm, run the following command:

docker swarm join \
--token SWMTKN-1-13z9uafwgjdkfv3ik18ttceqgtogdqr4xurhc6vaybeckx7i7u-2lnnyzeqb93ejgjrdlivsg7rf \
10.0.0.18:2377



$ docker swarm join-token worker
To add a worker to this swarm, run the following command:

docker swarm join \
--token SWMTKN-1-13z9uafwgjdkfv3ik18ttceqgtogdqr4xurhc6vaybeckx7i7u-b3a28we1he23rxwk2rea933y4 \
10.0.0.18:2377

More information: https://docs.docker.com/engine/reference/commandline/swarm_join-token/

like image 151
mrlitsta Avatar answered Oct 03 '22 22:10

mrlitsta