Results 1 to 9 of 9

Thread: Multiple applications on the same AMI instance

  1. #1
    Join Date
    Nov 2009
    Posts
    10

    Default Multiple applications on the same AMI instance

    It seems Cloudfoundry will launch a new AMI instance for each application I deploy. Is there a way to deploy multiple applications to the same AMI instance via cloudfoundry?

    This will really help me cut down cost as I don't have to run AMI multiple instances when the load can be handled by one instance, plus, I need both applications to run on the same instance as they share database, and jms resources via activemq.

    Any help will be appreciated

  2. #2
    Join Date
    Aug 2009
    Posts
    28

    Default

    It depends on what you define as a single application. If you create separate applications in Cloud Foundry, you will not be able to launch them on the same instance. However, each application can be comprised of multiple web applications (multiple WAR files), each with its own context root. This way, you can deploy multiple web applications in a single application server instance. Hope this helps.

    Charles

  3. #3
    Join Date
    Nov 2009
    Posts
    10

    Default

    I am not sure I understand what you are saying. From what I can see from the cloudfoundry deployment page, it asks for the location of a WAR file, so how can I package multiple WARs together within a single WAR? From my understanding, only an EAR can contain multiple WARs and cloudfoundry doesn't allow me to upload a WAR.

    Please clarify.

  4. #4
    Join Date
    Jun 2005
    Posts
    102

    Default

    Hello,

    Enter the path and context root for the first war.
    Then click the "add war" button: another set of input fields will apppear.
    Enter the path for the next war, and so on....

    Chris

  5. #5
    Join Date
    Jan 2010
    Posts
    7

    Default

    will it create and use the database specified in DataSource.groovy for each application respectively?

  6. #6
    Join Date
    Jun 2005
    Posts
    102

    Default

    No. Cloud Foundry creates a single database using the id/password/schema name specified by the Cloud Foundry application. You could, however, tell Cloud Foundry to execute one or more SQL scripts that configure additional users, databases etc.

  7. #7
    Join Date
    Jan 2010
    Posts
    7

    Default

    that would work perfect, thank you

  8. #8
    Join Date
    Nov 2009
    Posts
    10

    Default Thank you!

    Thanks Chris. You are a life saver! Things work perfectly now.

  9. #9
    Join Date
    Jan 2010
    Posts
    5

    Default

    Is there a simple way of supporting multiple domains to point to the same EC2 server?

    An an example, say I upload two WARs to two different contexts (/app1 and /app2). Say I also have two domains, domain1.com and domain2.com, where domain1.com should point to /app1 and domain2.com should point to /app2, without having to append /app1 or /app2 on the URL.

    Currently I only have one app deployed to ROOT context, and CNAME setting on my domain provider works. With two WARs, each with its own context, is there an easier way other than to write a third app (deployed to ROOT) that forwards to the correct context?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •