1 / 79

用 BOSH 自动部署大规模 云平台 Cloud Foundry

用 BOSH 自动部署大规模 云平台 Cloud Foundry. Henry Zhang, VMWare, China @ 张轩宁的围脖. Jacky Li, VMWare, China. 演讲内容. Cloud Foundry 云平台简介 Cloud Foundry 架构 Cloud Foundry 部署模型 BOSH 工作原理 用 BOSH 自动化部署 Cloud Foundry 用 BOSH 实现 Cloud Foundry 弹性 BOSH 应用实例. Cloud Foundry 云平台简介. 应用的复杂度 : 开发.

rafe
Télécharger la présentation

用 BOSH 自动部署大规模 云平台 Cloud Foundry

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 用BOSH自动部署大规模云平台Cloud Foundry Henry Zhang, VMWare, China @张轩宁的围脖 Jacky Li, VMWare, China

  2. 演讲内容 • Cloud Foundry云平台简介 • Cloud Foundry架构 • Cloud Foundry部署模型 • BOSH工作原理 • 用BOSH自动化部署Cloud Foundry • 用BOSH实现Cloud Foundry弹性 • BOSH应用实例

  3. Cloud Foundry 云平台简介

  4. 应用的复杂度: 开发 • Sound architecture: future proofing without overdoing • Unit and integration tests • Responding to changing business needs • Confusing technology landscape

  5. 应用的复杂度:部署和运维 Choosing the right hardware, operating system, web server Monitoring applications Responding to scalability needs Dealing with hardware- and system-level failures Upgrading without substantial down time

  6. 怎么办? 实际的 复杂度 内在的 复杂度 内在的和实际的复杂度 Implementation Implementation overhead Functional logic

  7. 云计算的三个层次

  8. Msg Services Cloud Foundry 开放 PaaS Data Services Cloud Provider Interface Application Service Interface Private Clouds Other Services PublicClouds Micro Clouds

  9. Msg Services Cloud Foundry 开放 PaaS Data Services Partners Cloud Provider Interface Application Service Interface Private Clouds Other Services Micro Clouds Apache2 license PublicClouds

  10. Cloud Foundry 的架构

  11. Cloud Foundry 层次 Clients Inner Shell (CF) Outer Shell(BOSH) Infrastructure as a Service Hardware (CPU, Memory, Storage, Network)

  12. Cloud Foundry 内壳(Inner Shell) Developers Routers Users CloudControllers App App Stagers HealthManager Execution Agents (DEA) Pool Services Messaging

  13. Cloud Foundry内部架构 App meta data • cloud • controller • stager • health • manager • cc - db • dea • dea • dea • dea • dea • package • cache • uaa - db • dea • redis • blobstore • uaa - AuthN staging logs • staging • jobs

  14. 设计原则 • 可动态发现组件 • 组件之间无依赖性 • 启动顺序无关 • 各组件独立的扩展

  15. Cloud Foundry部署模型

  16. Cloud Foundry 组件模型 ccdb app app uaa nats health manager service router stager cloud controller dea

  17. 单虚拟机或物理机 Cloud Foundry 部署模型(1)- 单结点 OS

  18. 每台虚拟机(或物理机)部署一个或数个组件 Cloud Foundry 部署模型(2)- 多结点 VM ccdb VM VM VM router router uaa VM VM cloud controller cloud controller VM health manager VM nats VM VM VM stager stager stager VM VM VM VM service service service service VM VM VM VM dea dea dea dea

  19. CloudFoundry.com生产系统部署的实例 • 500 – 5,000 VMs • 40+ unique node types • 75+ unique software packages • 75+ unique environments • Small team

  20. Cloud Foundry两种部署方法(1) • dev_setup 手工部署 • 直接在操作系统(ubuntu 10.04)中用脚本部署 • 可部署单结点或多结点 • 适合小规模实验的环境 • 支持虚拟机和物理机 • 每台机器需要手工安装和修改配置文件 • 系统扩容能力和弹性计算较差

  21. Cloud Foundry两种部署方法(2) • BOSH 自动部署 • 自动化大规模部署多结点系统 • 集中式的配置文件 • 支持自动化系统扩容 • 仅支持虚拟机 • 对各类IaaS平台集成 (CPI) • 在Cloudfoundry.com生产系统中使用

  22. BOSH工作原理

  23. 什么是BOSH? BOSH is a recursive definition of BOSH Outter SHell

  24. BOSH是大规模自动化管理工具 • 来自Cloud Foundry的开源项目 • 通用的自动化部署工具链 • 可以部署多种软件 • Cloud Foundry, • Gerrit, • Jenkins, • Wordpress, • MySQL, … • http://boshdb.com

  25. BOSH在Cloud Foundry中的作用 • 部署系统 • 更新配置 • 版本管理 • 监控运行

  26. BOSH的内部结构

  27. BOSH部署原理(1) BOSH CLI BOSH Operation Staff • BOSH是部署系统的总指挥 • 管理员通过BOSH CLI工具发送指令给BOSH

  28. BOSH部署原理(2) • CPI(Cloud Provider Interface)支持多种 IaaS • BOSH通过CPI管理IaaS层资源(虚拟机、虚拟存储、虚拟网络等) BOSH CLI BOSH Operation Staff CPI IaaS 创建虚拟机

  29. BOSH部署原理(3) BOSH CLI BOSH Operation Staff CPI Inner Shell VM VM VM VM . . . • BOSH调用CPI动态生成虚拟机 • Inner Shell – 被管理的部分 IaaS 创建虚拟机

  30. BOSH部署原理(4) BOSH CLI BOSH Operation Staff Stemcell CPI Inner Shell VM VM VM VM • Stemcell提供虚拟机模板 • Deployment manifest定义部署细节: IP地址、用户名/密码等 . . . IaaS 创建虚拟机 Deployment

  31. BOSH部署原理(5) BOSH CLI BOSH Operation Staff Stemcell CPI Inner Shell Deployment • 每个虚拟机内嵌一个Agent • 负责管理、控制、监控虚拟机 . . . IaaS 创建虚拟机 VM VM VM VM Agent Agent Agent Agent

  32. BOSH部署原理(6) BOSH CLI BOSH Operation Staff Stemcell CPI Inner Shell Deployment • Agent接收BOSH的指令 • 完成软件部署安装、应用起停、系统监控等任务 . . . IaaS 创建虚拟机 VM VM VM VM Agent Agent Agent Agent

  33. BOSH部署原理(7) BOSH CLI BOSH Operation Staff Stemcell CPI Inner Shell Deployment Release . . . • Release包含软件的源代码、目标码、版本、配置等信息 IaaS 创建虚拟机 VM VM VM VM Agent Agent Agent Agent

  34. Cloud Foundry平台的升级过程

  35. 滚动式升级:无状态(Stateless)组件 Incoming HTTP Requests Incoming HTTP Requests Incoming HTTP Requests Router Router Router CloudControllerv1 CloudControllerv1 CloudControllerv1 Create Create CloudControllerv2 CloudControllerv2 Message Bus Message Bus Message Bus Starting with v1 VMs If it works, add more v2 VMs... Deploy a v2 VM (canary)

  36. 例子:Cloud Controller Create Incoming HTTP Requests Router / LB 结果: 从v1升级到v2, 创建了新的虚拟机,中间没有宕机时间。 Incoming HTTP Requests Router / LB CloudControllerv2 Destroy CloudControllerv2 CloudControllerv1 Message Bus … while removing v1 VMs… Message Bus … until all VMs are v2

  37. 部署要点 • 并行升级 • 金丝雀(Canaries) • 最终一致性 (Eventual consistency)

  38. 有状态和无状态的VM • 无状态(stateless)VM • 没有持久化数据, • 升级时可以直接销毁(用新VM代替) • 有状态(stateful)的VM • 具有持久化的磁盘(如数据库数据) • 升级时需要保留持久化的磁盘

  39. 代码升级(不涉及数据)

  40. Stateful VM 升级

  41. VM 更新

  42. 用BOSH自动化部署Cloud Foundry(vSphere)

  43. BOSH的内部结构 • BOSH由6个虚拟机组成

  44. 安装BOSH的步骤 • 安装BOSH CLI (Ubuntu 10.04) • 部署Micro BOSH (单个VM) • 部署多结点分布式BOSH (6个VMs) BOSH CLI BOSH Micro BOSH VM VM VM VM VM VM VM

  45. 准备工作 - 软件 • 64-bit Ubuntu 10.04 LTS, better in ISO format. • vSphere V4.1 or V5.x, • vSphere client • vCenter (installed on a Win2008 R2 64bit or a Win2003 server, physical or virtual machine)

  46. 准备工作 – 硬件(1) * Cloud Foundry需要最少的结点数,实际中可能会更多。

  47. 准备工作 – 硬件(2) 物理服务器配置估算: 假定,每台虚拟机4GB内存,1vCPU, 则大约需要 4x 43 = 172 GB RAM, 1 x 43 = 43 vCPU,因此可以选用 6 台物理服务器:每台 8 核CPU,32GB RAM. • 较小配置 (部署实验环境) • 每台虚拟机256MB内存, • 1台物理服务器: 8 核CPU,16GB RAM. • 注:CPU在试验环境中不是最关键资源

  48. 准备工作 – 网络 • 建议分配4个VLAN • 足够的IP地址 • 结点之间可以连通,没有防火墙 • vSphere网络名称必须相同 • 必须直接连接 Internet (很重要!)

  49. 准备工作 – 网络 (2) 参考网络拓扑图

  50. 准备工作 – 网络 (3)vSphere 配置

More Related