Docker Community Forums

Share and learn in the Docker community.

Geo-seperated nodes in a swarm

Pardon my ignorance but I am unable to find a guide on this. I am looking to connect multiple physical nodes each behind a separate NAT router. I’m thinking that I would connect them all using a VPN connected to a virtual network hosted on AWS, Azure, or another cloud provider. Does this make sense? What would be the cheapest and or best securely network these nodes?

Geo-seperated implies hight latency. Swarm relies on RAFT for synchronizing its state beetween nodes. Konsensus algorithms like RAFT (most of them are) are time sensitive and depend on low latency connections between the nodes. There is a reason why you are uable to fine guides on this. Even if you manage to get it up and running, I highly doubt that it will reliable on the long run.

Bummer! Ok, well thank you for the response!

What I have set up in my case is multiple swarms (one per VPC) where I use my Terraform plugin

I usually have one production VPC per region and I have a specific swarm for collecting the logs (since not every region supports AWS ElasticSearch)

Between each VPC I set up a VPC connection peering which allows VPCs to talk with each other. Then I expose specific service ports (e.g. logstash, beats) and use a forwarder or socat to send the data across. The forwarder allows for better scaling, but sometimes a simple socat does the job.