Open arun-gupta opened 9 years ago
There should also be an option to make an existing machine a Swarm master.
I think this is totally possible by exposing the configureSwarm
function we have in libmachine/provision/utils.go
.
I think we could pretty easily have a join
command:
# add a couple machines to a cluster
$ docker-machine join --swarm-discovery xxx machine01 machine02
# make machine03 the master of a cluster
$ docker-machine join --swarm-master --swarm-discovery xxx machine03
One question on the second part: what happens if the cluster already has a master that docker-machine
knows about?
Only one master is permitted per cluster at this time so that should result in an error message. When multiple (redundant) masters are allowed then should be allowed to be added.
I think this feature is mandatory, just encountered a need for this and found this issue here.
BTW, what happens if the node that acts as the swarm-master goes down? Can any other node in the cluster become a swarm-master instantaneously using the same discovery token?
In general I am moving towards having some sort of docker-machine apply
command which would re-apply configuration for all things. E.g. engine options, swarm settings, TLS, and so on.
+1
Per the documentation at http://docs.docker.com/machine/#using-docker-machine-with-docker-swarm, only
docker create
command can be used to create a node and join the Swarm cluster. There should be an option to have an existing Machine join the swarm cluster as well.