在docker中使用overlay使用多主机联网功能需要群集 [英] Is swarm required for using multi-host networking feature using overlay in docker

查看:466
本文介绍了在docker中使用overlay使用多主机联网功能需要群集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在



文章 Docker Networks:发现覆盖服务引起了一些批评当前的服务发现工具不是为单独的容器注册或发现而构建的。


覆盖使用封面下的KV存储来建模网络拓扑,并使跨主机容器能够进行容器通信。它不提供 SRV记录解决方案。



呃是在覆盖网络中,每个容器都有自己的IP地址。

所以,你可以做这项工作的唯一方法是在网络上的每个容器中运行Consul代理一个服务。这对开发人员当然不透明,或与现成的图像兼容。



I have followed through the example at getting started overlay and i have a simple query. Is it possible to use multi-host networking feature using overlay without creating a swarm cluster? I don't want to use third party plugins like weave etc. I want to use docker native networking support for this.

I have 3.16+ kernel running RHEL and docker 1.9.

解决方案

Yes, it is possible: see "Lab 6: Docker Networking".
The key part of an overlay network is the discovery service, like for instance Consul.

An overlay network requires a key-value store.
The store maintains information about the network state which includes discovery, networks, endpoints, ip-addresses, and more. Engine supports Consul, etcd, and ZooKeeper (Distributed store) key-value store stores.

The article "Docker Networks: Discovering Services on an Overlay" lay some criticisms about the current service discovery tools which are not built for individual container registration or discovery.

Overlay uses KV stores under the covers to model the network topology and enable cross-host container to container communication. It does not provide SRV record resolution.

The rub is that in an overlay network every container has its own IP address.
So, the only way you could make this work is by running Consul agents inside of every container on the network that contributes a service. That is certainly not transparent to the developer, or compatible with off-the-shelf images.

这篇关于在docker中使用overlay使用多主机联网功能需要群集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆