CloudFoundry组件之间通信NATS MESSAGES

Cloud Foundry是业界领先的开源PaaS平台,它的内核采用Ruby开发。设计上使用以NATS消息系统为核心的松耦合组件架构,强调以NATS消息系统为核心的松耦合组件架构所带来的弹性。

NATS

一个轻量级的 发布-订阅, 分布式队列消息系统,基于EventMachine开发

本文重点将列出CF系统中,都有哪些 "NATS MESSAGES",并且对其功能做简单介绍。

Cloud Controller

Cloud Controller 是整个Cloud Foundry 的大脑,负责对整个系统的控制。包括我们通过VMC命令行工具,调用API 接口,实现对应用程序进行的管理。

NATS MESSAGES

  • Publish: dea.discover
  • Publish: dea.find.droplet
  • Publish: dea.locate
  • Publish: dea.start
  • Publish: dea.stop
  • Publish: dea.update
  • Publish: droplet.updated
  • Publish: healthmanager.health
  • Publish: healthmanager.status
  • Publish: router.register
  • Publish: router.unregister
  • Publish: vcap.cc.events
  • Publish: vcap.component.announce
  • Publish: vcap.stager.{queue}
  • Subscribe: cloudcontroller.bulk.credentials
  • Subscribe: cloudcontrollers.hm.requests
  • Subscribe: dea.advertise
  • Subscribe: router.start
  • Subscribe: vcap.component.discover

Droplet Execution Agent(简称DEA),对运行在Cloud Foundry上的所有app的运行实例进行管理。

NATS MESSAGES

[提示] 想了解DEA涉及的NATS MESSAGES建议参考上面给出的链接,我就不重复造轮子了。但除了nats messages 还有 ... ...
新版的dea为dea_ng, 现在默认还没有加入dev_setup里。而且新版多了以下特点:
- 整体结构更加模块化
- EM/fiber 对并发更友好
- Warden 的支持
- 文件目录的下载支持


Health Manager

Health Manager 监控在DEA中所有app的运行情况,并且可以根据不同情况给Cloud Controller 发出指令做出相应调整。比如:如果某个droplet发生异常退出,Health Manager 就可以告诉Cloud Controller 重启这个droplet。

NATS MESSAGES

Router模块 处理HTTP 请求,将请求转发到具体的运行于DEA中的app实例。它可以根据不同实例的URIs,监听实例的可用性。请求发出后能够匹配到指定的app, 再到这个app具体的实例。


NATS MESSAGES

当上传应用时,Stager 负责将app打包(package)。这过程由Cloud Controller 触发,并由某一特定的 staging 插件 完成。过程完成后'报告'给Cloud Controller 。

NATS MESSAGES


TODO

The Service Gateway is the main communcation channel for the Cloud Controller to interact with different services. The Service Gateways report to the Cloud Controller their availability and status, and the Cloud Controller makes requests back to them in order provision requested services.

The Service Gateways then communcate with the available Service Nodes to provision services and track which ones are already provisioned.

NATS MESSAGES


Service Nodes sit behind the Service Gateways. They typically deal with the finer details of provisioning the request service, such as setting up the MySQL database or starting a Redis instance.

You will normally have multiple Service Nodes reporting to a Service Gateway. The nodes are independent of each, while the gateways may be singular or in a clustered pair for high availability.

NATS MESSAGES


本文大部分来源于 http://apidocs.cloudfoundry.com/ 加上作者自己翻译整理,网站已经有半年没更新,但仍有一定参考价值,建议阅读。

展开阅读全文

没有更多推荐了,返回首页