Cloudify在雲環境下的引導過程
Cloudify使用引導程序為Cloudify管理以及部署應用所需的服務準備機器。
啟動程序負責分配機器(物理機或虛擬機器),安裝Cloudify元件模組所需的軟體(JDK)。通過Cloudify命令列中執行相關的命令啟動初始的引導程序。一般而言,載入程式執行以下任務:
- 從相關模板定義的可用機器資源池中分配一臺機器。更多模板資訊,請看Cloudify驅動檔案(Cloudify driver file)
- 通過SSH(*nix)或者WinRM(Windows)連線分配的機器。
- 安裝並啟動相關元件。
一旦引導程序連線到分配的機器,它會上傳引導機器所需的檔案。這一般包括存放於上傳資料夾的(<cloudifyRoot>/clouds/<cloudProviderName>/upload
下表描述了引導*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管理提供機器:通過Cloudify命令列的相關命令引導雲。例如本地環境的命令是bootstrap-localcloud
。特定雲環境的命令在其他相關的主題中。
一旦命令執行完成,會顯示Cloudify的Web管理控制檯的URL和Cloudify控制器的REST服務埠。另外,命令列也會把自動連線控制器作為引導的其中一個過程,所以不用手工執行connect命令進行連線。
啟動引導程序為應用服務準備機器:從Cloudify控制檯鍵入相關命令安裝應用。例如安裝PetClinic應用,install-application
-timeout
10 <cloudify root>/examples/petclinic-simple
接下來
想得到更多的關於特定雲環境的配置請見相關主題:
想得到更多的關於特定雲環境的引導資訊,請見相關主題: