

Cluster of Consuls is not 🙂 You’re right, swarm will restore services from failed node in another one. I don’t need a service for that, I simply need one-off container.ģ) Single node Consul configuration is a single point of failure to the network, sure. For instance, I’m not sure if that’s changed, but in swarm mode I found it inconvenient that I can’t start a container and simply let it die. With overlay network we’re dealing with only one network and applications need to know only the service names – Docker will do names resolution for us.Ģ) The point of the blog post is that we can do overlay network without swarm, not about that we should 🙂 But if you specifically don’t want to bring Swarm into this, using just the network is useful. Plus, in this case there will be at least three logical networks involved, which kind of not a big deal, but still three times more than we could have. However, applications somehow need to know what those addresses are, and we will be responsible for updating them when hosts move. First, let’s create a host for that:ġ) yes, we can expose the ports and let services to talk to each other via IP:port pairs. So we need to create a host with Consul installed on it. Easy peasy. Then it would be trivial to create an overlay network that spans across these hosts. After it’s up and running, we’ll create few Docker hosts and configure them to use one with Consul as cluster configuration storage. I’ll use Consul, but ZooKeeper and Etcd also would work. Out of the box Docker can work with several discovery services. But if we introduced a special service, whose sole job would be keeping a list of participating hosts, as well as network configuration in general, and then told Docker engines to use it, that would probably do the trick. But if it doesn’t, installation instructions are short and simple.Īs individual Docker hosts don’t know about each other, it would be tricky for them to share anything, especially something as complex as a network.
#Docker network hosts mac#
If you’re running Docker at Mac or Windows most likely it’s already installed. docker-machine – to create and provision those hosts.PrerequisitesĪs we’ll have to deal with several hosts, here’re some additional tools we’ll use: Configuring multi-host Docker network without Swarm is actually quite easy. Of cause, we could use Docker in Swarm mode and problem’s solved.

There should be one more component in order to make that happen. Unfortunately, you can’t just create overlay network and hope that it magically finds out about all participating hosts. It doesn’t even have to know where that container is. Overlay network can span across hosts boundaries, so your web application container at HostA can easily talk to database container at HostB by its name. Docker has several types of networks, but one of them is particularly interesting.
