我在服务器A中运行一个Web容器,在服务器B中运行一个数据库容器。
如何连接这两个容器?
我只知道如何连接在同一主机中运行的两个容器。
最佳答案
你需要一个:
A good way to think of Consul is broken into 3 layers.
The middle layer is the actual config store, which is not that different from etcd or Zookeeper.
The layers above and below are pretty unique to Consul.The killer feature of Consul is its service catalog. Instead of using the key-value store to arbitrarily model your service directory as you would with etcd or Zookeeper, Consul exposes a specific API for managing services.
Registrator is a single, host-level service you run as a Docker container.
It watches for new containers, inspects them for service information, and registers them with a service registry. It also deregisters them when the container dies.
It has a pluggable registry system, meaning it can work with a number of service discovery systems.
关于docker - 如何连接在两个不同主机中运行的两个容器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33757038/