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

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?

主站蜘蛛池模板: 博罗县| 错那县| 蓝田县| 横山县| 泸水县| 汉源县| 泰和县| 太仓市| 辛集市| 安塞县| 昆山市| 申扎县| 当涂县| 吕梁市| 泸州市| 乌鲁木齐市| 永昌县| 乌拉特前旗| 册亨县| 吉林省| 台山市| 崇信县| 辉南县| 安乡县| 三原县| 五指山市| 北票市| 饶平县| 镇宁| 冷水江市| 岑巩县| 三都| 介休市| 玉环县| 噶尔县| 凤庆县| 稻城县| 乐昌市| 广丰县| 通化市| 株洲市|