![]() ![]() 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. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |