What I want to accomplish is creating Swarm manager in one server and a worker on a different server. For this I’m using the following commands: - First I create the discovery service with:
docker-machine create -d virtualbox mh-keystore
eval "$(docker-machine env mh-keystore)"
docker run -d \
-p "8500:8500" \
-h "consul" \
progrium/consul -server -bootstrap
Then I create the manager:
docker-machine create \
-d virtualbox \
--swarm --swarm-master \
--swarm-discovery="consul://$(docker-machine ip mh-keystore):8500" \
--engine-opt="cluster-store=consul://$(docker-machine ip mh-keystore):8500" \
--engine-opt="cluster-advertise=eth1:2376" \
mhs-demo0
So far so good the problem is now when I create the worker on another server:
docker-machine create -d virtualbox \
--swarm \
--swarm-discovery="consul://IP:8500" \
--engine-opt="cluster-store=consul://IP:8500" \
--engine-opt="cluster-advertise=eth1:2376" \
mhs-demo1
How can I accomplish this without being it locally? I can only find tutorials online for doing it locally…
Thanks for the help Sérgio Mendes