Cloudify在云环境下的引导过程

Cloudify使用引导进程为Cloudify管理以及部署应用所需的服务准备机器。

启动进程负责分配机器(物理机或虚拟机),安装Cloudify组件模块所需的软件(JDK)。通过Cloudify命令行中运行相关的命令启动初始的引导进程。一般而言,引导程序执行以下任务:

  1. 从相关模板定义的可用机器资源池中分配一台机器。更多模板信息,请看Cloudify驱动文件(Cloudify driver file
  2. 通过SSH(*nix)或者WinRM(Windows)连接分配的机器。
  3. 安装并启动相关组件。

一旦引导进程连接到分配的机器,它会上传引导机器所需的文件。这一般包括存放于上传文件夹的(<cloudifyRoot>/clouds/<cloudProviderName>/upload)的启动脚本和其他所需文件,例如SSH密钥文件。一旦这些文件上传到机器,相关的引导脚本就会启动运行。

下表描述了引导*nix和Windows、管理以及运行应用服务的启动脚本。

Script OS Type Description
bootstrap-management.sh*nixShellThis script is used for bootstrapping both management and application service machines, and performs the following tasks as required:
  • Downloads the Cloudify distribution file
  • Installs Java (required to run the Cloudify agent)
  • Installs Cloudify
  • Runs the Cloudify agent
bootstrap-management.ps1 Windows PowerShell This script is used for bootstrapping both management and application machines, and performs the following tasks:
  • Downloads the Cloudify distrubtion file
  • Installs Java (required to run the Cloudify agent)
  • Installs Cloudify
bootstrap-client.ps1WindowsPowerShellThis script is used for launching commands on remote machine running Windows
引导管理机器将启动Cloudify控制器进程,而引导应用服务实例机器将只会启动Cloudify代理。Cloudify代理使得控制器能够使用服务实例机器安装和扩展服务。

下面按照支持的机器类型介绍引导过程:

Cloudify管理备用机

当有关云的驱动程序接收到引导云的请求后,它执行如下任务:

  1. 从管理机器模板定义的可用机器资源池中,通过云提供的API分配一台机器。
  2. 通过SSH或WinRM连接所分配的机器。
  3. 安装并启动Cloudify管理组件,包括Cloudify控制器和相关云的驱动。


应用程序服务备用机

当Cloudify控制器接收到安装应用程序的请求时,它请求相关的云驱动为应用程序准备所需的机器。云驱动准备机器的过程如下:

  1. 从提供服务相关模板定义的可用机器资源池中,通过云提供的API分配一台机器。
  2. 通过SSH或WinRM连接所分配的机器。
  3. 安装并启动Cloudify代理。
  4. 使用相关服务的安装脚本初始化服务安安装。


使用在传统数据中心自定义的驱动分配机器,如果资源池中没有可用机器,会显示一条错误消息:

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
JDKJDK 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
  • All ports open between machines in same service
  • All ports open between management machines and all other machines
  • On the management machine, ports 8099 and 8100 must be open for communication from the Internet via the machine’s public IP address. This allows the Cloudify shell to interact with the REST server and allows users to access the management web application.
  • All ports open between machines in same service
  • All ports open between management machines and all other machines
  • On the management machines, ports 8099 and 8100 must be open for communication from the Internet via the machine’s public IP address. This allows the Cloudify shell to interact with theREST server and allows users to access the management web application.
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
  • Windows file sharing enabled on port 445 (CIFS)
  • WinRM enabled on port 5985
    To enable WinRM on your machine before bootstrapping a cloud, at the PowerShell prompt with administrative credentials, type the following commands:
    • set-itemWSMan:\localhost\Client\TrustedHosts -Value * -Force
    • set-itemWSMan:\localhost\Shell\MaxMemoryPerShellMB -Value 0 -Force
    • Enable-PSRemoting
    • Set-ExecutionPolicy unrestricted
    Setting TrustedHosts to ‘*’ has security implications. Please consult with your IT department before running this command.
  • Windows PowerShell installed and included in the system path on the client machine (the machine where Cloudify shell is installed and runs the bootstrap-cloud command) and management machines. (Exists by default on Windows 7 and Windiws Server 2008)
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

接下来

想得到更多的关于特定云环境的配置请见相关主题:

想得到更多的关于特定云环境的引导信息,请见相关主题:



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值