9

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

Community
  • 1
  • 1
andreaxi
  • 931
  • 5
  • 15
  • 28

3 Answers3

10

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.

Christopher
  • 42,720
  • 11
  • 81
  • 99
  • Ok, thanks Christopher. I achieved to create my custom AMI starting from the EB one, but as soon as i change the java version (following http://biztech.sheprador.com/?p=153) i've got problems and my application becomes ureachable... – andreaxi Aug 17 '12 at 14:49
  • What's catalina.out telling you? – Christopher Aug 17 '12 at 14:57
  • I'm starting from 0 again. Now I'm reproducing all the steps suggested. Hope to have positive news...Let you know, thanks. – andreaxi Aug 18 '12 at 15:15
  • It's a steep climb up the learning but once you reach the summit it's pretty easy to maintain. Nothing in Amazon is truly that difficult. It's just figuring out the syntax and procedures that takes all the time. – Christopher Aug 18 '12 at 15:21
  • Does this still work for you? When I search "beanstalk" in the Marketplace, there is only one third-party AMI listed. – Mark Berry Feb 04 '15 at 17:00
  • @MarkBerry, When on the AMI selection screen, choose the "Community AMIs" tab on the left. You'll get more results then. – salsbury Oct 19 '16 at 14:35
6

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
  • 2,043
  • 2
  • 21
  • 24
  • 1
    What does this get you? You can just grab the AMI id from the running instance. The point was to have a clean EB AMI to then customize. If you try to customize an already deployed system, you'll accidentally hardcode some configs. – Kousha Nov 12 '14 at 23:23
  • There should be another step b/w step 1 and step 2, in which we customise the instance according to our needs and then save the AMI for the newly configured isntance. – Pratik Singhal Feb 15 '17 at 05:02
1

@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.

Thi
  • 2,066
  • 1
  • 17
  • 12