Weitere Ă€hnliche Inhalte Ăhnlich wie Deploy your Multi-tier Application in Cloud Foundry (20) Mehr von cornelia davis (20) KĂŒrzlich hochgeladen (20) Deploy your Multi-tier Application in Cloud Foundry1. 1© Copyright 2013 Pivotal. All rights reserved. 1© Copyright 2013 Pivotal. All rights reserved.
Deploying a Multi-tier App in
Cloud Foundry
A tour
Cornelia Davis
Cloud Foundry Platform Engineering
cdavisafc@gopivotal.com | twitter: @cdavisafc | March 2014
3. 3© Copyright 2013 Pivotal. All rights reserved.
Overview: Deploying App to
Cloud Foundry Runtime
â Upload app
bits and
metadata
push app
Router
⥠Create and bind services
âą Stage application
⣠Deploy application
†Manage application health
âŠwhich is a whole ânother meetup topic
Cloud Foundry
Runtime (PaaS)
Blobstore DB
Cloud
Controller
Service Broker
Node(s)
DEA
DEA
DEA
DEA
+ app MD
+ =
Service
credentials
5. 5© Copyright 2013 Pivotal. All rights reserved.
Software is Changing Industries
$3.5B valuation
âFinancial Services
$3.5B valuation
â Travel & Hospitality
$3.5B valuation
â Transportation
$1.1B acquisition by
Monsanto â Agriculture
$19B valuation
â Entertainment
$3.2B acquisition by
Googleâ Digital Home
6. 6© Copyright 2013 Pivotal. All rights reserved.
Reference Application from VMWare to demonstrate the vFabric Suite
Spring Trader
https://github.com/cf-platform-eng/springtrader-cf
8. 8© Copyright 2013 Pivotal. All rights reserved.
Agenda
ï Cross-site scripting
ï JNDI ï Service Catalog
ï Spring Cloud
ï Apps and Manifests
ï Services plans
ï Auto reconfiguration
9. 9© Copyright 2013 Pivotal. All rights reserved.
Cross-site Scripting
http://springtrader.com/services
http://springtrader.com/web
10. 10© Copyright 2013 Pivotal. All rights reserved.
Cross-site Scripting
http://traderweb.cfapps.io
http://traderservices.cfapps.io
11. 11© Copyright 2013 Pivotal. All rights reserved.
Cross-site Scripting
http://traderfront.cfapps.io
One war file
12. 12© Copyright 2013 Pivotal. All rights reserved.
JNDI ï Service Instances
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/nanodb" />Old:
13. 13© Copyright 2013 Pivotal. All rights reserved.
Spring Cloud
VCAP_SERVICES locally
cf bind-service traderfront devsql
cf bind-service traderfront stagingsql
OR
<cloud:data-source id="dataSource">
<cloud:connection
properties="sessionVariables=sql_mode='ANSI';
characterEncoding=UTF-8;defaultTransactionIsolation=2â/>
<cloud:pool pool-size="2" max-wait-time="200" />
</cloud:data-source>
VCAP_SERVICES={"cleardb-
n/a":[{"name":"tradersql","label":"cleardb-
n/a","tags":["mysql","relational"],"plan":"spark","credentials":{"jdbcUrl":"jd
bc:mysql://baf8a1e6a292a2:79581497@us-cdbr-east-
05.cleardb.net:3306/ad_595d583f143adee","uri":"mysql://baf8a1e6a292a2:79581497
@us-cdbr-east-
05.cleardb.net:3306/ad_595d583f143adee?reconnect=true","name":"ad_595d583f143a
dee","hostname":"us-cdbr-east-
05.cleardb.net","port":"3306","username":"baf8a1e6a292a2","password":"79581497
"}}],"cloudamqp-n/a":[{"name":"tradermessaging","label":"cloudamqp-
n/a","tags":["amqp","rabbitmq"],"plan":"lemur","credentials":{"uri":"amqp://kl
rdpgoo:mLpx_XtpEY7eJg-rG489FRs_J-jArqP6@tiger.cloudamqp.com/klrdpgoo"}}]}
New:
14. 14© Copyright 2013 Pivotal. All rights reserved.
(Big-A) Applications and Manifests
http://traderfront.cfapps.io
One war file
Another war file
15. 15© Copyright 2013 Pivotal. All rights reserved.
(Big-A) Applications and Manifests
---
timeout: 180
memory: 1G
domain: cfapps.io
instances: 1
services:
- tradersql
- tradermessaging
applications:
- name: traderback
path: dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war
host: traderback
- name: traderfront
path: dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war
host: traderfront
16. 16© Copyright 2013 Pivotal. All rights reserved.
(Big-A) Applications and Manifests
---
timeout: 180
memory: 1G
domain: cfapps.io
instances: 1
services:
- tradersql
- tradermessaging
applications:
- name: traderback
path: dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war
host: traderback
- name: traderfront
path: dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war
host: traderfront
---
timeout: 180
memory: 1G
domain: cfapps.io
instances: 1
services:
- devsql
- devmessaging
applications:
- name: traderback
path: dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war
host: traderback
- name: traderfront
path: dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war
host: traderfront
17. 17© Copyright 2013 Pivotal. All rights reserved.
(Big-A) Applications and Manifests
---
timeout: 180
memory: 1G
domain: cfapps.io
instances: 1
services:
- tradersql
- tradermessaging
applications:
- name: traderback
path: dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war
host: traderback
- name: traderfront
path: dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war
host: traderfront
---
timeout: 180
memory: 1G
domain: cfapps.io
instances: 1
services:
- devsql
- devmessaging
applications:
- name: traderback
path: dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war
host: traderback
- name: traderfront
path: dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war
host: traderfront
---
timeout: 180
memory: 1G
domain: cfapps.io
instances: 1
services:
- stagingsql
- stagingmessaging
applications:
- name: traderback
path: dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war
host: traderback
- name: traderfront
path: dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war
host: traderfront
19. 19© Copyright 2013 Pivotal. All rights reserved.
Auto-reconfiguration
<rabbit:connection-factory id="connectionFactory"
host="${NANO_RABBIT_HOST:localhost}"
port="${NANO_RABBIT_PORT:5672}"/>
Old:
New:
<cloud:rabbit-connection-factory id="connectionFactory"/>
DO NOT USE AUTORECONFIGURATION!! (esp. in production)
20. 20© Copyright 2013 Pivotal. All rights reserved.
Pull Requests Welcome!
ï Cross-site scripting
ï Session State Caching
21. 21© Copyright 2013 Pivotal. All rights reserved.
State, Statelessness and Scale
Cloud Controller Health Manager
Stateless part of your app Stateful part
Browser
CLI
Native
App
Mobile
App
DEA
DEA
Application Runners (DEA)
Router
Hinweis der Redaktion Cloud Foundry PaaS
An application runs in a DEA, which is a droplet execution agent. The Cloud Controller orchestrates the routing and lifecycle of all DEAs in the pool. Routers manage application traffic. Health Manager reports mismatched application states to the CC. A service broker provides an interface for services (native or external). A messaging bus manages all system communication. Apps are accessed directly through the router while web and CLI clients (e.g., vmc, STS) access Cloud Controller via RESTful services.
Software is eating the world - executives cite software as the top factor impacting their organizations. Companies effectively using software development to achieve competitive advantage are more profitable than their peers
Organizations such as Square ($3.5B valuation, Financial Services), Uber ($3.5B valuation, Transportation), Netflix ($19B valuation, Media and Entertainment), Airbnb ($3.5B valuation, Hospitality), the Climate Corporation ($1.1B acquisition, Agriculture) and Etsy ($600M valuation, Boutique Retail) are using software to change industries and disrupt business models Push the app Push the app Push the app