Docker Community Forums

Share and learn in the Docker community.

Docker swarm on 2 physical macbooks


(Docker4chan) #1

Hi,

I have 2 macbooks and I am trying to setup a swarm cluster with the 2 physical hosts acting as master and workers. Is this even possible? (I am unable to find documentation regarding setting up swarm cluster across multiple physical hosts where all the hosts are macs)

On a single machine (using multiple VM’s and through docker-machine) I am able to setup a swarm cluster.
My objective is to start a swarm cluster (either directly on host or through docker machine such that the docker-machine hosts across multiple physical machines can talk to each other)

Any help would be much appreciated.

Thanks


(Xxradar) #2

Hi,
If you are using docker-machine and virtualbox to host the docker images on the different physical machines, you might have to look at all the NATting being ok, because that might mess up things badly. When you change the adapter settings on the VM’s to bridge mode (and reboot the image), that should make things easier. Then create the swarm.

I did not try, but running docker for mac on both machines, that shoud be ok in my opnion if no firewalling is active.

Kind regards


(Docker4chan) #3

Thanks so much @xxradar ! setting network adapter to bridged mode did the trick.
However it seems docker machine is not able to ssh to the VM in bridged mode (is this normal?).

Here’s what I did (for benefit of others)

Macbook 1 - Start a VM in bridged mode , using virtual box login and initialize swarm manager with advertise-addr to the ip from dhcp

Macbook2 - (normal macbook docker (no VM)) join using join token for worker directly


#4

Hi,
a bit late, but can still we useful:

Regards,