Didier Durand
Didier Durand

Reputation: 657

Several apps (i.e war files) on same Beanstalk instance

In order to be conservative on resources (and costs), I would like to put more than 1 war file (representing different apps) on the same EC2 beanstalk instance.

I would like then to have appl A mapping to myapp.elasticbeanstalk.com/applA using warA and appl B mapping to myapp.elasticbeanstalk.com/applB using warB

But, the console allows you to upload a single and only war for any instance.

1) So, I understand that its not possible with the current interface. Am I right ?

2) Though, is is possible to achieve this via "non-standard" ways: uploading warA via interface and copying / updating warB to /tomcat6/webapps via ssh, ftp, etc ?

3) With (2), my concern is that B will be lost each time BT health checker decides to terminate the instance (successive failed checks for example) and restart a new one. I would then have to make warB as part of my customized AMI used by applA and create a new version of this AMI each time i update warB

Please, help me

regards

didier

Upvotes: 4

Views: 3190

Answers (4)

James Xabregas
James Xabregas

Reputation: 766

This is an old question but it took me some time to find a more up to date answer so I thought I'd share my findings.

Multiple WAR deployment is now supported natively by Elastic Beanstalk (and has been for some time).

Simply create a new zip file with each of your WAR files inside of it. If you want one of them to be available at the root context name it ROOT.war like you would if you were deploying to Tomcat manually.

Your zip file structure should looks like so:

MyApplication.zip

├── .ebextensions

├── foo.war

├── bar.war

└── ROOT.war

Full details can be found in the Elastic Beanstalk documentation.

The .ebextensions folder is optional and can contain configuration files that customize the resources deployed to your environment. See Elastic Beanstalk Environment Configuration for information on using configuration files.

Upvotes: 2

aldrinleal
aldrinleal

Reputation: 3609

There another hack which allows you to boot an arbitrary jar by installing java and using a node.js boot script:

http://docs.ingenieux.com.br/project/beanstalker/using-arbitrary-platforms.html

Hope it helps

Upvotes: 0

aldrinleal
aldrinleal

Reputation: 3609

There is a workaround though, but not using Beanstalk, but plain EC2:

https://forums.aws.amazon.com/thread.jspa?messageID=229121

http://blog.jetztgrad.net/2011/02/how-to-customize-an-amazon-elastic-beanstalk-instance/

Shameless plug: While not related directory, I've made a plugin for Maven 2 to automate Beanstalk deployments and Elastic MapReduce as well. Check out http://beanstalker.ingenieux.com.br/

Upvotes: 3

Stephane Rainville
Stephane Rainville

Reputation: 476

You are correct ! You can not (yet ) have multiple war in beanstalk.

Amazon Forum answer is here https://forums.aws.amazon.com/thread.jspa?messageID=219284

Upvotes: 3

Related Questions