docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

How to set up swarm across machines #2346

Open land007 opened 9 years ago

land007 commented 9 years ago

docker-machine create \ -d virtualbox \ --swarm --swarm-image="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

docker-machine create -d virtualbox \ --swarm --swarm-image="swarm:1.0.0-rc2" \ --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-demo1

How to make mhs-demo0 and mhs-demo1 to the two separate real mac os, I have studied for several days. $ (docker-machine ip mh-keystore) = 192.168.0.2 This has been replaced, but still can not find mhs-demo1 eval $ (docker-machine env --swarm mhs-demo0), the network is not bridged because virtualbox it? I now use docker-machine create a bridged network can not be established, because they are nat network.

dgageot commented 8 years ago

Hi @land007 Here's how you could create such a cluster: https://github.com/docker/swarm-frontends/blob/master/init_swarm.sh