Cloud foundry practice

33
CloudFoundry Practice Sean@Weaveus May 2011

Transcript of Cloud foundry practice

Page 1: Cloud foundry practice

CloudFoundryPracticeSean@Weaveus

May 2011

Page 2: Cloud foundry practice

History

• VMware founded 1998

• x86/x64 OS Emulation & Binary Translation

• VMware Workstation 1999

• VMware Server 2001

• EMC buys VMware$625M 2004

Diane Greene

2Monday, May 9, 2011

Page 3: Cloud foundry practice

History

• Prepare DataCenter,Cloud 2007-

• Old CEO fired,new CEO Paul fromEMC Cloud Service

• Buy SpringSource $420M, Move to Platform, 2009

• CloudFoundry 2011

Paul Maritz

3Monday, May 9, 2011

Page 4: Cloud foundry practice

History - Spring

• Started 2002, Rod Johnson, Juergen Holler

• Lightweight Application Platform (then JEE)

• Spring 1.0, 2004

• Spring 2.0, 2006, Spring 2.5, 2007

• Spring 3.0, 2009, Acquired to VMware

4Monday, May 9, 2011

Page 5: Cloud foundry practice

Cloud History

• Google founded 1996~8

• GFS 2003, BigTable 2004, Gmail 2004, Docs 2006

• Salesforce 1999

• Facebook founded 2004

• Facebook Platform 2007

• Twitter founded 2006

• Amazon EC2 2006

• Oracle buys Sun 2009

5Monday, May 9, 2011

Page 6: Cloud foundry practice

CloudFoundry

6Monday, May 9, 2011

Page 7: Cloud foundry practice

CloudFoundry

7Monday, May 9, 2011

Page 8: Cloud foundry practice

Server/Client

• VCAPVMware Cloud Application Platform

• Ubuntu Server

• VMCVMware Cloud CLI

• Any with Ruby, Java, Python

8Monday, May 9, 2011

Page 9: Cloud foundry practice

Ruby App Demo

9Monday, May 9, 2011

Page 10: Cloud foundry practice

Ruby App Demo

• Target -VCAP (host api.vcap.me)

• Ubuntu Server 10.04 LTS(on VMware Fusion)

• VCAP Installed & Started Client

• Client

• Ruby1.8

• Sinatra

Page 11: Cloud foundry practice

Ruby Demo - EnvSeanMacBookPro:foo sean$ pwd/Users/sean/Documents/Projects/CloudFoundry/fooSeanMacBookPro:foo sean$ cat foo.rb require 'rubygems'require 'sinatra'

get '/' do host = ENV['VCAP_APP_HOST'] port = ENV['VCAP_APP_PORT'] "<h1>Ruby-Sinatry CloudFoundry</h1><h2>#{host}:#{port}</h2>"endSeanMacBookPro:foo sean$ vmc info

VMware's Cloud Application PlatformFor support visit [email protected]

Target: http://api.vcap.me (v0.999)Client: v0.3.10

User: [email protected]: Memory (0B of 2.0G total) Services (0 of 16 total) Apps (0 of 20 total)SeanMacBookPro:foo sean$

11Monday, May 9, 2011

Page 12: Cloud foundry practice

Ruby - Demo - PushSeanMacBookPro:foo sean$ vmc push fooWould you like to deploy from the current directory? [Yn]: Application Deployed URL: 'foo.vcap.me'? Detected a Sinatra Application, is this correct? [Yn]: Memory Reservation [Default:128M] (64M, 128M, 256M, 512M, 1G or 2G) Creating Application: OKWould you like to bind any services to 'foo'? [yN]: Uploading Application: Checking for available resources: OK Packing application: OK Uploading (0K): OK Push Status: OKStaging Application: OK Starting Application: OK

SeanMacBookPro:foo sean$ vmc push foo -n// ‘-n’ no questions

SeanMacBookPro:foo sean$ vmc list

+-------------+----+---------+-------------+----------+| Application | # | Health | URLS | Services |+-------------+----+---------+-------------+----------+| foo | 1 | RUNNING | foo.vcap.me | |+-------------+----+---------+-------------+----------+

SeanMacBookPro:foo sean$ vmc update foo// after a modification of // the application

12Monday, May 9, 2011

Page 13: Cloud foundry practice

Spring App Demo

13Monday, May 9, 2011

Page 14: Cloud foundry practice

Spring Demo

• Target - VCAP (host api.vcap.me)

• Ubuntu Server 10.04 LTS(on VMware Fusion)

• VCAP Installed & Started

• Client

• SpringSource Tool Suite 2.6

14Monday, May 9, 2011

Page 15: Cloud foundry practice

15Monday, May 9, 2011

Page 16: Cloud foundry practice

16Monday, May 9, 2011

Page 17: Cloud foundry practice

Spring Application with Local TC Server

17Monday, May 9, 2011

Page 18: Cloud foundry practice

18Monday, May 9, 2011

Page 19: Cloud foundry practice

19Monday, May 9, 2011

Page 20: Cloud foundry practice

ApplicationList

on VCAP

20Monday, May 9, 2011

Page 21: Cloud foundry practice

Actually Fails ‘push’with my VCAP on VM

21Monday, May 9, 2011

Page 23: Cloud foundry practice

Spring Application fails ‘deploy’

23Monday, May 9, 2011

Page 24: Cloud foundry practice

Spring App Demo Refs

• http://blog.springsource.com/2011/04/13/using-cloud-foundry-from-sts/

• https://github.com/SpringSource/cloudfoundry-samples/wiki/Spring-Hello-MongoDB-Sample-Application

24Monday, May 9, 2011

Page 25: Cloud foundry practice

Node.JS App Demo

25Monday, May 9, 2011

Page 26: Cloud foundry practice

!"

26Monday, May 9, 2011

Page 27: Cloud foundry practice

In Depth

27Monday, May 9, 2011

Page 28: Cloud foundry practice

VCAP

• Cloud Controller

• Health Manager

• Router

• DEA: Droplet Execution Agent

• Services

• NATS - as a Bus. Pub/Sub Messaging

28Monday, May 9, 2011

Page 29: Cloud foundry practice

NAT

VCAP

Front-EndNginx Router

CloudController

DEA(App.

Server Node)

HealthManager

RedisNode

RedisGateway

MySQLNode

MySQLGateway

MongoDB Node

MongoDBGateway

Redis

MySQL

MongoDB

VMCClient

Redis

MySQL

MongoDB

DEA(App.

Server Node)

http://blog.cloudfoundry.com/post/5223861703/how-cloud-foundry-works-when-a-new-

application-is

http://blog.cloudfoundry.com/post/4754582920/cloud-

foundry-open-paas-deep-dive

29Monday, May 9, 2011

Page 30: Cloud foundry practice

root 26338 0.0 0.0 27996 184 ? Ss 10:59 0:00 nginx: master process /usr/sbin/nginxwww-data 26339 0.0 0.2 28732 1052 ? S 10:59 0:00 nginx: worker processsean 27634 0.1 2.0 60932 10300 ? Sl 11:00 1:01 nats-server sean 27637 0.2 3.7 94856 19080 tty1 Sl 11:00 1:02 ruby /home/sean/cloudfoundry/vcap/router/bin/routersean 27654 0.2 13.2 415380 66804 tty1 Sl 11:00 1:25 ruby ./cloud_controllersean 27669 0.3 5.7 107768 29072 tty1 Sl 11:00 1:43 ruby /home/sean/cloudfoundry/vcap/dea/bin/deasean 27711 0.2 9.4 170548 47656 tty1 Sl 11:00 1:05 ruby /home/sean/cloudfoundry/vcap/health_manager/bin/health_managersean 27743 0.1 7.0 136772 35460 tty1 Sl 11:00 0:59 ruby /home/sean/cloudfoundry/vcap/services/redis/bin/redis_gatewaysean 27781 0.1 1.4 139800 7180 tty1 Sl 11:00 0:57 ruby /home/sean/cloudfoundry/vcap/services/redis/bin/redis_nodesean 27800 0.1 7.0 136900 35436 tty1 Sl 11:00 1:01 ruby /home/sean/cloudfoundry/vcap/services/mysql/bin/mysql_gatewaysean 27817 0.3 6.0 144764 30612 tty1 Sl 11:00 1:52 ruby /home/sean/cloudfoundry/vcap/services/mysql/bin/mysql_nodesean 27836 0.1 7.2 136744 36680 tty1 Sl 11:00 0:59 ruby /home/sean/cloudfoundry/vcap/services/mongodb/bin/mongodb_gatewaysean 27853 0.1 7.3 142744 36900 tty1 Sl 11:00 0:57 ruby /home/sean/cloudfoundry/vcap/services/mongodb/bin/mongodb_node

VCAP Processes

30Monday, May 9, 2011

Page 31: Cloud foundry practice

#$

31Monday, May 9, 2011

Page 32: Cloud foundry practice

CloudFoundry

32Monday, May 9, 2011

Page 33: Cloud foundry practice

References

• Images

• http://cache.gawkerassets.com/assets/images/34/2008/08/GreeneAPRisberg.jpg

• http://infosmackpodcasts.com/infosmack-63-vmwares-paul-maritz/

• http://blog.springsource.com/2011/04/12/launching-cloud-foundry/

• http://blog.springsource.com

• http://blog.cloudfoundry.com/

33Monday, May 9, 2011