Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

customize Elastic Beanstalk instances

We are deploying a java web application in Elastic Beanstalk. The Beanstalk by default provides Redhat instances with Tomcat7 & openjdk. But i want to customize the instances so that i can use Sunjdk. Followed the steps as mentioned here, I launched a new instance from EC2 & installed sun jdk, tomcat7 and created a custom AMI of the instance and provided its ID in Custom AMI id field in edit Environment configuration in BeanStalk. But my Environment Health status is changing to RED, and the application is not deployed. Can you please suggest me a solution for this.

like image 939
Sangram Anand Avatar asked Nov 08 '11 11:11

Sangram Anand


People also ask

How do I change the instance type in Elastic Beanstalk?

In the navigation pane, choose Configuration. In the Instances configuration category, choose Edit. Make changes to settings in this category, and then choose Apply.

Which of the following can be used to customize your Elastic Beanstalk environment?

Customize your Elastic Beanstalk environment Use the option_settings key to modify the environment configuration. You can choose from general options for all environments and platform-specific options.

How do you make custom AMI in Elastic Beanstalk?

To create a custom AMIOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . Choose Launch Instance. Choose Community AMIs. If you identified a base Elastic Beanstalk AMI (using describe-platform-version ) or an Amazon Linux AMI, enter its AMI ID in the search box.

How do I customize my AMI?

Log in to the AWS Management Console, display the EC2 page for your region, then click Instances. Choose the instance from which you want to create a custom AMI. Click Actions and click Create Image. Type a name for Image Name that is easily identifiable to you and, optionally, input text for Image Description.


1 Answers

I have done exactly what you want to do, and am happy to report that it works. In my first attempts I encountered the same issue. Make sure that you:

  • 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. This is very important, as Flashing a beanstalk launched EC2 instance won't work!!
  • install Sun's Java as per these instructions, to make sure all the environment and symbolic links are correct. https://forums.aws.amazon.com/message.jspa?messageID=251168#251168
  • be patient, as I found for some reason Tomcat takes longer to spin up than with the default OpenJDK config.

If you still can't get it, make sure you check the logs in /opt/tomcat7/logs/catalina.out - I hit a mysterious VerifyException that was resolved by uploading a new .jar to the environment, and I also ran out of permgen space almost immediately, which was resolved by upping the values in the 'Container' configuration area of the beanstalk 'edit configuration'.

like image 93
Peter Avatar answered Oct 06 '22 01:10

Peter