Cloudify使用引導(dǎo)進程為Cloudify管理以及部署應(yīng)用所需的服務(wù)準(zhǔn)備機器。
啟動進程負(fù)責(zé)分配機器(物理機或虛擬機),安裝Cloudify組件模塊所需的軟件(JDK)。通過Cloudify命令行中運行相關(guān)的命令啟動初始的引導(dǎo)進程。一般而言,引導(dǎo)程序執(zhí)行以下任務(wù):
一旦引導(dǎo)進程連接到分配的機器,它會上傳引導(dǎo)機器所需的文件。這一般包括存放于上傳文件夾的(<cloudifyRoot>/clouds/<cloudProviderName>/upload)的啟動腳本和其他所需文件,例如SSH密鑰文件。一旦這些文件上傳到機器,相關(guān)的引導(dǎo)腳本就會啟動運行。
下表描述了引導(dǎo)*nix和Windows、管理以及運行應(yīng)用服務(wù)的啟動腳本。
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 |
下面按照支持的機器類型介紹引導(dǎo)過程:
當(dāng)有關(guān)云的驅(qū)動程序接收到引導(dǎo)云的請求后,它執(zhí)行如下任務(wù):
當(dāng)Cloudify控制器接收到安裝應(yīng)用程序的請求時,它請求相關(guān)的云驅(qū)動為應(yīng)用程序準(zhǔn)備所需的機器。云驅(qū)動準(zhǔn)備機器的過程如下:
使用在傳統(tǒng)數(shù)據(jù)中心自定義的驅(qū)動分配機器,如果資源池中沒有可用機器,會顯示一條錯誤消息:
Failed to create a new cloud node for template <your template name>, all available nodes are currently used
如果出現(xiàn)此錯誤,應(yīng)用安裝的請求不會撤銷,Cloudify控制器會繼續(xù)反復(fù)嘗試,直到有一臺可用機器。停止這一過程,可以從Cloudify命令行中用Ctrl-C結(jié)束安裝命令,然后運行相應(yīng)的卸載命令。
Cloudify的目標(biāo)是最小化服務(wù)器的前提條件,這樣可讓標(biāo)準(zhǔn)的操作系統(tǒng)能夠不預(yù)先安裝特定軟件,可以即刻運行Cloudify。下面的表格中列出了引導(dǎo)機器所需的前提條件:
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. |
|
另外,不同的云環(huán)境有其自己的特定配置。下面是在云環(huán)境下的預(yù)先配置:
云驅(qū)動文件:描述可被不同的Recipes引用關(guān)聯(lián)的模板和別名。每個模板定義了可用機器的資源池。
引導(dǎo)管理腳本。
網(wǎng)絡(luò)共享。
Cloudify分發(fā)文件在本地的存放位置。
云環(huán)境管理控制臺的身份信息(認(rèn)證信息、憑證等)
下面的過程描述了引導(dǎo)云和應(yīng)用程序的過程:
啟動Cloudify管理控制臺,更多信息請見 Installing the Cloudify Shell
啟動引導(dǎo)進程為Cloudify管理提供機器:通過Cloudify命令行的相關(guān)命令引導(dǎo)云。例如本地環(huán)境的命令是bootstrap-localcloud
。特定云環(huán)境的命令在其他相關(guān)的主題中。
一旦命令執(zhí)行完成,會顯示Cloudify的Web管理控制臺的URL和Cloudify控制器的REST服務(wù)端口。另外,命令行也會把自動連接控制器作為引導(dǎo)的其中一個過程,所以不用手工執(zhí)行connect命令進行連接。
啟動引導(dǎo)進程為應(yīng)用服務(wù)準(zhǔn)備機器:從Cloudify控制臺鍵入相關(guān)命令安裝應(yīng)用。例如安裝PetClinic應(yīng)用,install-application
-timeout 10 <cloudify root>/examples/petclinic-simple
想得到更多的關(guān)于特定云環(huán)境的配置請見相關(guān)主題:
想得到更多的關(guān)于特定云環(huán)境的引導(dǎo)信息,請見相關(guān)主題: