Cloudify使用引导进程为Cloudify管理以及部署应用所需的服务准备机器。
启动进程负责分配机器(物理机或虚拟机),安装Cloudify组件模块所需的软件(JDK)。通过Cloudify命令行中运行相关的命令启动初始的引导进程。一般而言,引导程序执行以下任务:
- 从相关模板定义的可用机器资源池中分配一台机器。更多模板信息,请看Cloudify驱动文件(Cloudify driver file)
- 通过SSH(*nix)或者WinRM(Windows)连接分配的机器。
- 安装并启动相关组件。
一旦引导进程连接到分配的机器,它会上传引导机器所需的文件。这一般包括存放于上传文件夹的(<cloudifyRoot>/clouds/<cloudProviderName>/upload)的启动脚本和其他所需文件,例如SSH密钥文件。一旦这些文件上传到机器,相关的引导脚本就会启动运行。
下表描述了引导*nix和Windows、管理以及运行应用服务的启动脚本。
Script | OS | Type | Description |
---|---|---|---|
bootstrap-management.sh | *nix | Shell | This script is used for bootstrapping both management and application service machines, and performs the following tasks as required:
|
bootstrap-management.ps1 | Windows | PowerShell | This script is used for bootstrapping both management and application machines, and performs the following tasks:
|
bootstrap-client.ps1 | Windows | PowerShell | This script is used for launching commands on remote machine running Windows |
下面按照支持的机器类型介绍引导过程:
Cloudify管理备用机
当有关云的驱动程序接收到引导云的请求后,它执行如下任务:
- 从管理机器模板定义的可用机器资源池中,通过云提供的API分配一台机器。
- 通过SSH或WinRM连接所分配的机器。
- 安装并启动Cloudify管理组件,包括Cloudify控制器和相关云的驱动。
应用程序服务备用机
当Cloudify控制器接收到安装应用程序的请求时,它请求相关的云驱动为应用程序准备所需的机器。云驱动准备机器的过程如下:
- 从提供服务相关模板定义的可用机器资源池中,通过云提供的API分配一台机器。
- 通过SSH或WinRM连接所分配的机器。
- 安装并启动Cloudify代理。
- 使用相关服务的安装脚本初始化服务安安装。
使用在传统数据中心自定义的驱动分配机器,如果资源池中没有可用机器,会显示一条错误消息:
Failed to create a new cloud node for template <your template name>, all available nodes are currently used
如果出现此错误,应用安装的请求不会撤销,Cloudify控制器会继续反复尝试,直到有一台可用机器。停止这一过程,可以从Cloudify命令行中用Ctrl-C结束安装命令,然后运行相应的卸载命令。
先决条件
Cloudify的目标是最小化服务器的前提条件,这样可让标准的操作系统能够不预先安装特定软件,可以即刻运行Cloudify。下面的表格中列出了引导机器所需的前提条件:
Prerequisite | Windows | *nix |
---|---|---|
JDK | JDK 1.6 or higher — download the latest update available (e.g.JDK 6 Update 23) | JDK 1.6 or higher — download the latest update available (e.g.JDK 6 Update 23) |
Available Disk Space | 500 MB | 500 MB |
Network Ports |
|
|
Credentials | username and password; Active Directory is not supported in this version. | username and password, or username and .pem file; Kerberos not supported in this version. |
Operating System Specific Requirements |
Cloudify uses PowerShell to run commands on remote machines. Therefore, you must use a client machine running Windows to bootstrap a machine running Windows; however, a client machine running Windows can bootstrap a machine runnnig *nix. |
|
另外,不同的云环境有其自己的特定配置。下面是在云环境下的预先配置:
云驱动文件:描述可被不同的Recipes引用关联的模板和别名。每个模板定义了可用机器的资源池。
引导管理脚本。
网络共享。
Cloudify分发文件在本地的存放位置。
云环境管理控制台的身份信息(认证信息、凭证等)
引导
下面的过程描述了引导云和应用程序的过程:
启动Cloudify管理控制台,更多信息请见 Installing the Cloudify Shell
启动引导进程为Cloudify管理提供机器:通过Cloudify命令行的相关命令引导云。例如本地环境的命令是bootstrap-localcloud
。特定云环境的命令在其他相关的主题中。
一旦命令执行完成,会显示Cloudify的Web管理控制台的URL和Cloudify控制器的REST服务端口。另外,命令行也会把自动连接控制器作为引导的其中一个过程,所以不用手工执行connect命令进行连接。
启动引导进程为应用服务准备机器:从Cloudify控制台键入相关命令安装应用。例如安装PetClinic应用,install-application
-timeout 10 <cloudify root>/examples/petclinic-simple
接下来
想得到更多的关于特定云环境的配置请见相关主题:
- Configuring a Local Cloud
- Configuring Azure
- Configuring EC2
- Configuring OpenStack
- Configuring a Traditional Data Center [BYON]
- Bootstrapping a Local Cloud
- Bootstrapping Azure
- Bootstrapping EC2
- Bootstrapping OpenStack
- Bootstrapping a Traditional Data Center [BYON]