官术网_书友最值得收藏!

Service discovery in the Swarm cluster

The old (standalone) Swarm required a service registry so that all its managers can have the same view of the cluster state. When instantiating the old Swarm nodes, we had to specify the address of a service registry. However, if you take a look at setup instructions of the new Swarm (Swarm Mode introduced in Docker 1.12), you'll notice that we did not set up anything beyond Docker Engines. You will not find any mention of an external service registry or a key-value store.

Does that mean that Swarm does not need service discovery? Quite the contrary. The need for service discovery is as strong as ever, and Docker decided to incorporate it inside Docker Engine. It is bundled inside just as Swarm is. The internal process is, essentially, still very similar to the one used by the standalone Swarm, only with less moving parts. Docker Engine now acts as a Swarm manager, Swarm worker, and service registry.

The decision to bundle everything inside the engine provoked a mixed response. Some thought that such a decision creates too much coupling and increases Docker Engine's level of instability. Others think that such a bundle makes the engine more robust and opens the door to some new possibilities. While both sides have valid arguments, I am more inclined towards the opinion of the latter group. Docker Swarm Mode is a huge step forward, and it is questionable whether the same result could be accomplished without bundling service registry inside the engine.

Knowing how Docker Swarm works, especially networking, the question that might be on your mind is whether we need service discovery (beyond Swarms internal usage). In The DevOps 2.0 Toolkit, I argued that service discovery is a must and urged everyone to set up Consul (https://www.consul.io/) or etcd (https://github.com/coreos/etcd) as service registries, Registrator as a mechanism to register changes inside the cluster, and Consul Template or confd (https://github.com/kelseyhightower/confd) as a templating solution. Do we still need those tools?

主站蜘蛛池模板: 神木县| 桐乡市| 定兴县| 镇江市| 清丰县| 壤塘县| 葫芦岛市| 德安县| 榆中县| 米脂县| 临桂县| 大庆市| 永春县| 珠海市| 松阳县| 临沭县| 历史| 永年县| 衡阳市| 阜新| 庆云县| 灵寿县| 民乐县| 县级市| 江津市| 台山市| 乐至县| 汶上县| 阿城市| 荃湾区| 防城港市| 科技| 阳高县| 望江县| 彭水| 家居| 巴林右旗| 竹山县| 八宿县| 鄯善县| 亳州市|