将独立的服务发现放在Docker Swarm的群集机器中,有什么区别呢? [英] What is the different between putting a separate service discovery and integrate it into the cluster machine in Docker Swarm

查看:183
本文介绍了将独立的服务发现放在Docker Swarm的群集机器中,有什么区别呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解分离的服务发现服务器的需求,同时我们可以通过任何协议将从节点注册到从节点启动时的主节点。托管另一个服务对我来说似乎是多余的。

解决方案



(图形来自



(图片来自使用Docker,Consul和nginx进行简单路由和服务发现由...撰写的文章 Ladislav Gazo



目标是分离自己的容器中的基础架构问题(Discovery服务),与开发工具关注(Swarm)分开。


I am having problem understanding the need of a separated service discovery server while we could register the slave node to the master node at the slave node start-up through whatever protocol. Hosting another service seem redundant to me.

解决方案

Docker Swarm is there to create a cluster of hosts running Docker and schedule containers across the cluster.
It does not include service discovery, which is provided by a backend service, such as etcd, consul or zookeeper.

  • The first problem: service registration and discovery is an infrastructure concern, not an application concern.
  • The second problem: implementing service registration and discovery when infrastructure and application implementation are mutually agnostic is tough.

The DockerCon makes that distinction clear this morning (Nov. 16th, 2015), with the "Docker Stack":


(Graphics from @laurelcomics)

Docker networking solves these problems by backing an interface (DNS) with pluggable infrastructure components that adhere to a common KV interface.

You can see consul.io used in:

That means:

  • Consul is a KV (Key/Value) store which can be plugged into Swarm in order to manage the service discovery aspect.
  • Swarm is the access layer, which is usually the layer that contains a gateway or routing component that allows others to actually reach your services.

(Image from the "Easy routing and service discovery with Docker, Consul and nginx" article written by Ladislav Gazo)

The goal is to isolate what is an infrastructure concern (Discovery service) in its own container, separate from a dev tool concern (Swarm).

这篇关于将独立的服务发现放在Docker Swarm的群集机器中,有什么区别呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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