SPECIFICATION OF NODE'S ROLE(节点定义)
Node | Role Spec |
---|---|
Provider |
The provider exposes remote services 提供者暴露远端服务 |
Consumer |
The consumer calls the remote services 消费者调用远端服务 |
Registry |
The registry is responsible for service discovery and configuration 注册者负责服务发现和配置 |
Monitor |
The monitor counts the number of service invocations and time-consuming 监控者计数服务的调用和时间消耗 |
Container |
The container manages the services's lifetime 容器管理着服务的生命周期 |
SERVICE RELATIONSHIP(服务关系)
-
Container
is responsible for launching, loading, and running the serviceProvider
. 容器负责启动,加载和运行服务提供者。 -
Provider
registers its services toRegister
at the time it starts. 提供者在启动时向注册中心注册服务。 -
Consumer
subscribes the services it needs from theRegister
when it starts. 消费者启动时向注册中心订阅自身需要的服务。 -
Register
returns theProvider
s list toConsumer
, when it changes, theRegister
will push the changed data toConsumer
through long connection. 注册中心返回提供者的集合给消费者,当提供者发生改变时,注册中心会通过长连接提交改变的数据给消费者。 -
Consumer
selects one of theProvider
s based on soft load balancing algorithm and executes the invocation, if fails, it will choose anotherProvider
. 消费者基于负载均衡算法选择其中一个提供者并且执行调用,如果失败,则选择另一个提供者。 - Both
Consumer
andProvider
will count the number service invocations and time-consuming in memory, and send the statistics toMonitor
every minute. 消费者和提供者都会在内存中计数服务调用和时间消耗,并且每隔一分钟发送统计数据给监控者。
Dubbo has the following features: Connectivity, Robustness, Scalability and Upgradeability.
Dubbo有以下特色,连接性,健壮性,可拓展性和可升级性。
Connectivity(连接性)
-
Register
is responsible for the registration and search of service addresses, like directory services,Provider
andConsumer
only interact with the registry during startup, and the registry does not forward requests, so it is less stressed - 注册中心是负责注册和查找服务地址,像目录服务,提供者和消费者在启动时跟注册中心交互,并且注册中心不转发请求,所以压力较小。
- 'Monitor' is responsible for counting the number of service invocations and time-consuming, the statistics will assembles in
Provider
's andConsumer
's memory first and then sent toMonitor
- 监控者时负责计数服务的调用和时间消耗,统计数据首先会在服务提供端和消费端组建再发送给监控者。
- 'Provider' registers services to 'Register' and report time-consuming statistic(not include network overhead) to 'Monitor'
- 提供者注册服务到注册中心并且上报时间消耗统计数据(不包括网络开销)给监控者
- 'Consumer' gets a list of service provider addresses from
Registry
, call the provider directly according to the LB algorithm, report the time-consuming statistic toMonitor
, which includes network overhead - 消费者从注册中心获取提供者的一个集合,根据LB(load balance)算法直接调用服务提供者,上报时间消耗统计数据给监控者,不包括网络开销。
- The connections between
Register
,Provider
andConsumer
are long connections,Moniter
is an exception - 注册者,提供者和消费者之间的连接是长连接,监控者是例外。
-
Register
is aware of the existence ofProvider
through the long connection, whenProvider
gets down,Register
will push the event toConsumer
- 注册者通过长连接发现(意识)到提供者的存在,当提供者宕掉的时候,注册者会提交事件给消费者(也可以说是通知消费者)。
- It doesn't affect the already running instances of
Provider
andConsumer
even all of theRegister
andMonitor
get down, sinceConsumer
got a cache ofProvider
s list - 即使所有的注册者和监控者都宕掉了也不影响已经在运行的提供者和消费者的实例,由于消费者缓存了提供者集合。
-
Register
andMonitor
are optional,Consumer
can connectProvider
directly - 注册者和监控者是可选的,消费者可以直连提供者。
Robustness(健壮性)
-
Monitor
's downtime doesn't affect the usage, only lose some sampling data - 监控者下线不影响使用,只会丢失一些样本数据
- When the DB server goes down,
Register
can return serviceProvider
s list toConsumer
by checking its cache, but newProvider
cannot register any services - 当DB服务宕掉的时候,注册者可以通过检查其缓存返回提供者的集合给消费者(意思是注册中心缓存了提供者信息),但是新的提供者就不能注册服务了。
-
Register
is a peer cluster, it will automatically switch to another when any instance goes down - 注册者是一个对等集群,当实例宕掉时它会自动选择切换到另一个实例。
- Even all
Register
's instances go down,Provider
andConsumer
can still conmunicate by checking their local cache - 即使所有的注册者实例都宕掉了,提供者和消费者根据本地的缓存仍然可以交互。
- Service
Provider
s are stateless, one instance's downtime doesn't affect the usage - 服务提供者是无状态的,一个实例宕掉不影响使用。
- After all the
Provider
s of one service go down,Consumer
can not use the that service, and infinitely reconnect to wait for serviceProvider
to recover - 在一个服务所有的提供者都宕掉时,消费者就不能使用那个服务了,并且会无限的重试等待服务提供者恢复。
Scalability(可拓展性)
-
Register
is a peer cluster that can dynamically increases its instances, all clients will automatically discover the new instances. - 注册者是一个可以动态创建实例对等集群,所有的客户端会自动发现新的实例。
-
Provider
is stateless, it can dynamically increases the deployment instances, and the registry will push the new service provider information to theConsumer
. - 提供者是无状态的,它可以动态的增加部署实例,并且注册中心会提交新的服务提供者信息给消费者。
Upgradeablity(可升级性)
When the service cluster is further expanded and the IT governance structure is further upgraded, dynamic deployment is needed, and the current distributed service architecture will not bring resistance. Here is a possible future architecture:
当服务集群进一步扩展和IT治理结构进一步升级时,需要实现动态部署,当前的分布式服务架构不会带来阻力。这是一个未来可能的架构:
SPECIFICATION OF NODE'S ROLE(节点角色说明)
Node | Role Spec |
---|---|
Deployer |
Local proxy for automatic services deployment(一个为自动服务部署的本地代理) |
Repository |
The repository is used to store application packages(一个用于存储程序包的仓库) |
Scheduler |
The scheduler automatically increases or decreases service providers based on the access pressure (一个基于访问压力自动增加和减少服务提供者的调度器) |
Admin |
Unified management console(统一管理控制台) |
Registry |
the registry is responsible for service discovery and configuration (注册者负责服务发现和配置) |
Monitor |
The monitor counts the service call times and time-consuming (监控者计数服务调用次数和时间消耗) |