Question

I need to use on Elastic Beanstalk a Java application written for Glassfish server. Beacuse of Amazon doesn't let me choose an AMI with Glassfish, I choosed one with Tomcat and i modified my application to work properly on Tomcat.

Now, I've seen I also needed to use a Sun JDK, while by default Elastic Beanstalk AMI comes with openjdk. I googled a lot, finding some (not so many resources) interesting posts like this answer on StackOverflow

What I can't understand is this part of the answer:

Create your custom AMI from a running instance of Amazon's beanstalk AMI that you manually launch from EC2, NOT one that was launched from starting your application through beanstalk.

So, my question is: does anyone how to use a custom AMI with Glassfish on Elastic Beanstalk? If it's not possible, can someone explain me how to create the custom AMI?

Thanks, Andrea

Was it helpful?

Solution

That answer just means "Don't start a beanstalk application and cut an AMI directly from one of those instances. Instead, launch an instance based on the beanstalk AMIs (which are available in the public AMI listing)." I.e., use one of these; note there are 84 of them:

Beanstalk AMIs

Cut your own private AMI when you're done configuring that instance, and specify it in your beanstalk environment.

OTHER TIPS

I personally found the selected answer confusing for me to follow, maybe because I am still climbing up the AWS learning curve. Maybe this answer will help other newbies. Having just figured out how to successfully launch an Elastic Beanstalk instance with my own custom AMI, what I believe this quote is saying, is to do the following totally non-obvious steps which just worked for me:

  1. Go to the EC2 services (not Elastic Beanstalk services) and launch an instance based on the Elastic Beanstalk AMI that you would like to use as a starting point for your custom AMI. You will throw this away in a minute.

  2. Select the instance and choose "Create Image / EBS AMI". Once created, you can delete the temporary EC2 instance you created. It's only purpose was to create the custom AMI.

  3. Now go to Elastic Beanstalk services and edit your configuration to reference your custom AMI.

@Danger It would speed up the scaling up process.

I'm using a docker app on EB but "docker pull" from Docker Hub is so slow so when all instances are unhealthy my site would be down in 15-30 minutes. Create a customize AMI and pull a base Docker image will save time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top