Deploy your Multi-tier Application in Cloud Foundry

2,267 views

Published on

Walk through the modifications made to a Spring app (mostly config) to deploy it to the Cloud Foundry PaaS.

Published in: Software
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,267
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
92
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • 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
  • Deploy your Multi-tier Application in Cloud Foundry

    1. 1. 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
    2. 2. 2© Copyright 2013 Pivotal. All rights reserved. Let’s push an app
    3. 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
    4. 4. 4© Copyright 2013 Pivotal. All rights reserved. Software
    5. 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. 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
    7. 7. 7© Copyright 2013 Pivotal. All rights reserved. From here …
    8. 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. 9© Copyright 2013 Pivotal. All rights reserved. Cross-site Scripting http://springtrader.com/services http://springtrader.com/web
    10. 10. 10© Copyright 2013 Pivotal. All rights reserved. Cross-site Scripting http://traderweb.cfapps.io http://traderservices.cfapps.io
    11. 11. 11© Copyright 2013 Pivotal. All rights reserved. Cross-site Scripting http://traderfront.cfapps.io One war file
    12. 12. 12© Copyright 2013 Pivotal. All rights reserved. JNDI  Service Instances <jee:jndi-lookup id="dataSource" jndi-name="jdbc/nanodb" />Old:
    13. 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. 14© Copyright 2013 Pivotal. All rights reserved. (Big-A) Applications and Manifests http://traderfront.cfapps.io One war file Another war file
    15. 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. 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. 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
    18. 18. 18© Copyright 2013 Pivotal. All rights reserved. Services Marketplace and Plans
    19. 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. 20© Copyright 2013 Pivotal. All rights reserved. Pull Requests Welcome!  Cross-site scripting  Session State Caching
    21. 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
    22. 22. 22© Copyright 2013 Pivotal. All rights reserved. … to here
    23. 23. A NEW PLATFORM FOR A NEW ERA

    ×