天天看點

CloudFoundry申請試用

今年4月份,VMware突然釋出了業内第一個開源的PaaS——CloudFoundry。那麼何為PAAS?

PAAS平台即Platform-as-a-Service:平台即服務),把伺服器平台作為一種服務提供的商業模式。通過網絡進行程式提供的服務稱之 為SaaS(Software as a Service),而雲計算時代相應的伺服器平台或者開發環境作為服務進行提供就成為了PaaS(Platform as a Service)。Cloud Foundry為開發者建構了具有足夠選擇性的PaaS,她的優勢在于:

    開發架構的選擇性;

    應用架構服務的選擇性;

    部署應用的雲的選擇性。

    通過提供三個次元的開放架構,Cloud Foundry客服了當今PaaS方案的限制。最近業界釋出的PaaS平台都限制在非标準的架構下,并且缺乏多種應用服務的支援能力,特别是不能将應用跨越私有雲和公有雲進行部署。

VMware還借此機會推出了Micro Cloud

    解決方案,這是一個新的開源PaaS計劃。通過“微雲”,開發者可以在自己的機器上建立和測試他們的應用,在提高開發效率的同時,還能確定開發環境和生産環境的一緻性。

    RedMonk首席分析師Stephen O"Grady表示:“開發者對于PaaS解決方案的潛在優勢充滿了興趣,但實際對于這種方案的采用卻被非标準化元件和架構帶來的威脅所阻撓。通過 Cloud Foundry,VMware為開發者提供了一個許可自由且功能多樣的PaaS平台,可以提供多種不同的開發語言選擇。”

    Cloud Foundry拓展了VMware對于開放PaaS的承諾,能夠廣泛支援各種開發架構和程式設計語言以及多樣的應用服務和雲部署環境。Cloud Foundry還可以傳遞高度的便攜性,使開發者能夠在雲服務提供商和企業級資料中心之間自由移動自己的應用。

    Cloud Foundry支援多種流行高效的程式設計架構,包括Spring for Java、Ruby on Rails、Sinatra for Ruby和Node.js,也支援其他基于JVM的架構,例如Grails。Cloud Foundry還支援多種應用服務,包括MySQL、MongoDB、Redis以及VMware自己的vFabric應用服務。

來簡單嘗試一下cloudfoundry:

1.  到cloudfoundry官網使用自己的郵件位址注冊一個賬号:ttp://www.cloudfoundry.com/,點選Free Sign Up for Cloud Foundry,在48小時之内你會收到cloudfoundry發來的郵件,裡面有一個臨時密碼可供你登入。

<a href="http://img1.51cto.com/attachment/201111/173515373.jpg" target="_blank"> </a>

<a href="http://img1.51cto.com/attachment/201111/173808472.jpg" target="_blank">650) this.width=650;"&gt;</a>

2.收到郵件後我們就可以安裝vmc了。郵件大緻内容如下:

Thank you for your interest in Cloud Foundry - the industry's first open platform as a service.

We have approved your request for a Cloud Foundry account.

Your credentials are listed below.

  Email: [email protected]

  Temporary password: n8O6XLmm

These credentials enables you to deploy applications to CloudFoundry.com and download your Micro Cloud Foundry

To start using CloudFoundry.com you should first download the vmc command line tool and change your password. To learn how to download and use this tool please follow the instructions here:

<a href="http://support.cloudfoundry.com/entries/20012337-getting-started-guide-command-line-vmc-users">http://support.cloudfoundry.com/entries/20012337-getting-started-guide-command-line-vmc-users</a>

我們的應用需要通過攻擊vmc才能上傳到paas平台。我的作業系統是ubuntu11.10

安裝vmc:

root@cloude2~# gem install vmc

通路cloudfoundry:

root@cloude2~# vmc target api.cloudfoundry.com

Succesfully targeted to [http://api.cloudfoundry.com] 

通過vmc登入我們先前在cloudfoundry注冊的賬号

root@cloude2:~# vmc login

Email: [email protected]

Password: ********

Successfully logged into [http://api.cloudfoundry.com]

建立一個簡單的應用上傳上去看看效果如何

root@cloude2:~# cd /

root@cloude2:/# mkdir hello

root@cloude2:/# cd hello/

root@cloude2:/hello# vim hello.rb

require 'sinatra'

get '/' do

 "Hello from chanjet !"

end

root@cloude2:/hello# ll

-rw-r--r--  1 root root   57 2011-11-05 03:08 hello.rb

上傳我們建立好的應用--hello.rb

root@cloude2:/hello# vmc push

Would you like to deploy from the current directory? [Yn]:  //預設回車

Application Name: hello   //為我們的應用取個名字

Application Deployed URL: 'hello.cloudfoundry.com'? zhaohh.cloudfoundry.com

Detected a Sinatra Application, is this correct? [Yn]: //預設回車

Memory Reservation [Default:128M] (64M, 128M, 256M, 512M, 1G or 2G) 2G   //我很貪心(*^__^*)

Creating Application: OK

Would you like to bind any services to 'hello'? [yN]: //預設回車

Uploading Application:

  Checking for available resources: OK

  Packing application: OK

  Uploading (0K): OK  

Push Status: OK

Staging Application: OK                                                        

Starting Application: OK                                                       

通過vmc修改我們賬号密碼(非必須):

root@cloude2:/hello# vmc passwd

Changing password for '[email protected]'

New Password: ******

Verify Password: ******

Successfully changed password

root@cloude2:/hello#

3.通路我剛剛建好的應用吧。在浏覽器裡輸入zhaohh.cloudfoundry.com

<a href="http://img1.51cto.com/attachment/201111/173127324.jpg" target="_blank">650) this.width=650;"&gt;</a>

到此,一個最最簡單的應用已經部署完畢。

上一篇: 雲排行