Any application deployed to Elastic Beanstalk causes it to degrade - java

I am developing a Java Web App with the NetBeans IDE and AWS Elastic Beanstalk. I have created an RDS and S3 instance, where my application can successfully interact with both. However, my application can only interact with both RDS and S3 when the application is run locally through WildFly.
Whenever I try and deploy the application to Elastic Beanstalk, the instance becomes degraded. I believe I have configured both RDS and S3 instances correctly, i.e. attaching the correct security groups.
For debugging purposes, I created a blank Java Web App through NetBeans (generic Hello, World! JSP) and when I deployed that application to Elastic Beanstalk, the instance also became degraded. Therefore, I have concluded that whenever I deploy ANY application to Elastic Beanstalk, the instance degrades.
Why is Elastic Beanstalk degrading? Especially with a simple Hello World! application?
Any help would be greatly appreciated.
Thanks.

Related

How to configure Glassfish on AWS Elastic Beanstalk, Connection Pool and Realm

I developed a Java EE 7 application, that uses Glassfish as the application server and MySQL as the database.
locally every thing is working correctly
now, I want to deploy the application to the cloud using AWS.
after reading some official documentations:
I created The database in the cloud 'AWS RDS', and conneted to it from MySQL Workbench and also The application in my workspace was able to connect to it and act on it.
Now for The application deployment I used Elastic Beanstalk with Glassfish 4.1 Java 8 (the docker one).
The probleme is that I need to configure Glassfish In AWS to
Create JDBC Connection Pool
Create JDBC Resource
Create A Security Realm
so that the apllication can work correctly.
How Can I do This?
I switch to Jelastic, I can access admin page usign their cloud, and I already deployed my appication

Amazon Web Service Deployment - free tier

I'm trying to use the AWS free tier for host a java web application. I created an EC2 instance but i don't figure out how can I deploy the application to this instance. I was trying to use the AWS Toolkit for eclipse to deploy the web site to Elastic Beanstalk, but from here i need a second tier to deploy the application to the production.
My question is: What is the free solution to make a deploy to my EC2 instance and how?
Thank you!
If you are using Elastic Beanstalk ( which I recommend), then you should create the Beanstalk stack manually from the AWS console. Before you do that, I suggest you to terminate your other instance, because you wont use that.
The beanstalk stack will create an EC2 instance in the background, also an RDS database if you ask for it. You pay for the resources ( EC2, RDS), but no extra cost for the "Beanstalk stack".
After you having the Beanstalk stack, you can deploy it with the Eclipse plugin, or just simply generate the WAR file and upload it via the AWS console. ( On the Beanstalk page there is a place to upload a war file for deployment.)
Be aware to set the DB connection details to the RDS ( if you are using it).
Also note that the free tier is nice to warm up but not recommended for production.
When you create the Beanstalk stack make sure you create a single AZ web frontend, so you will have only 1 webserver running.

publishing and hosting the webservice on cloud

I have web service that is up and running that is in other words it is publish on my tomat on port 8080 and I can hit it through my browser now I want that my webservice to be get published on cloud so that I can pass wsdl uri to any one in the world and he can access my wsdl. Please advise how to achieve this ..!!will Amazon provide such facilities.
I've tried various options and Amazon's Elastic Beanstalk is the most seamless. You can launch your Java webservice by simply uploading a war. However, it does require an EC2 instance to be running.
Other options are Heroku and Windows Azure
Heroku has a free tier and uses Maven/Git to deploy the app to their server. https://devcenter.heroku.com/articles/deploy-a-java-web-application-that-launches-with-jetty-runner
Windows Azure also has instructions on how to deploy a java webapp on their platform. http://www.windowsazure.com/en-us/develop/java/
Given these options, In my personal opinion, the cheapest is Heroku and the most convinient is Amazon Elastic Beanstalk.

How to deploy a Java EE application in the Amazon cloud?

Here's the thing: I need to take a certain Java EE web app and deploy it to Amazon EC2 (which I will need to setup first) starting next month (using the http://aws.amazon.com/free/faqs/ AWS Free Tier Usage - hope it supports Tomcat + MySQL/PostgreSQL).
The problem: I have never ever deployed a Java EE app (not even a normal one on a dedicated hosting) nor have I setup an Amazon EC2 enviorment.
Are there any, idiot proof preferably, tutorials/how-to's/whatever on doing it from the very beginning (signing up to Amazon) till the very end (when your app is all up and running)?
I did find some tutorials on how to setup an Amazon EC2 instance, how to normally deploy a Java EE app but what I'm looking for is a single tutorial putting it all together.
Start with an Ubuntu AMI. Then install tomcat. Now put the WAR file of your J2EE app where tomcat can see it. You can use the AWS console to start/stop your machines, configure firewall rules that allow you to access port 80, etc. There won't be a step by step guide telling you exactly what to do, welcome to being a programmer.
Once we have the instance (like Ubuntu) running http://youtu.be/hJRSti6DsJg then, installs Glassfish (Java EE server) and configure it to work with Java EE. It depends more of the instance itself (Ubuntu) than EC2 Amazon... here a nice video (how to install Glashfish in Ubuntu + Netbeans config) http://youtu.be/CKuoDm6bqRM
Note:
Keep in mind both videos are a little old (may some adjustments are necessary)
The videos are indirectly related. But my point is: there isn't much info about Amazon AWS and Java EE, but there are a lot info about Amazon AWS and Linux, and Linux and Java EE.
Update
You can try Amazon Beanstalk (Deployment & Management) integrated with Netbeans (without Glashfish?) http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.html
SSH to Elastic Beanstalk instance
http://aws.amazon.com/java/ (Amazon + Java)
Boxfuse now supports deploying Java EE applications using either Tomcat, TomEE Web Profile or TomEE Plus to AWS with a single command
boxfuse run mytomeeapp-1.0.war -env=prod
This will create an image, provision all necessary AWS infrastructure (AMIs, security groups, auto-scaling groups, launch configurations, ELBs, Elastic IPs, ...) and launch the instances. It supports blue/green zero downtime updates with Elastic IPs and ELBs.
You can find a tutorial here: https://boxfuse.com/blog/javaee-aws
Disclaimer: I am the founder and CEO of Boxfuse

Run Java EE app on EC2

Can anyone point me to the steps/resources that describe:
How to deploy a Java EE app on amazon-EC2
Maintain changes to the meta-data of the app server (deploy new applications) after an instance reboot (probably using amazon-ebs)
First check this out if you haven't already ran through it:
http://docs.aws.amazon.com/gettingstarted/latest/awsgsg-intro/intro.html
it'll give you an idea of how it all works.
With regard to running a Java EE app on EC2, you have a couple of choices - but they generally come down to the following recipe:
Start an instance
Install a Java EE application server (tomcat/glassfish/websphere/...)
Install your application (war/ear) into the application server
Now you can bundle the above into an ebs ami, or you can write a script (bash/sh/tcl) which applies those changes when your instance starts (which i prefer). The scripts allow you to modify what gets installed/started/moved around without having to rebundle your instance.
There's some great resources here: http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=100
Hope that helps.
How to deploy a Java EE app on amazon-EC2
You still deploy to an application server so it isn't really different. If you have more specific questions, please clarify. But have a look at Running JEE applications on Amazon EC2 and How to deploy a java web application on an ec2 instance.
Maintain changes to the meta-data of the app server (deploy new applications) after an instance reboot (probably using amazon-ebs)
If you use Amazon EBS, then you don't need to worry, Amazon EBS volumes are off-instance storage that persists independently from the life of an instance.
The Amazon AWS's newly Launched Elastic BeanStalk is here to resolve you concerns.
You can deploy Java EE apps on Amazon Ec2 instances via Bean Stalk. All you need to do is create a new applications and create a environment in it and add you WAR file for deploying, AWS has its own version of Tomcat 6/7 with open JDK which can be customized to Sun JDK if required.
Therefore Amazon offers complete Deployment tool to start using your app by just deploying in BeanStalk. BeanStalk offer Auto Scaling & Elastic Load balancing and a lots more to customize your application Environment.
If you start an ebs-booted instance, you do not need to care about persistency after a reboot (see http://aws.amazon.com/about-aws/whats-new/2009/12/03/amazon-ec2-instances-now-can-boot-from-amazon-ebs/)
Concerning the deployment of Java EE, I don't see any difference to deploying it on a non-virtual OS.
Boxfuse supports deploying Java EE applications using either Tomcat, TomEE Web Profile or TomEE Plus to AWS with a single command
boxfuse run mytomeeapp-1.0.war -env=prod
This will create an image, provision all necessary AWS infrastructure and launch the instances. It supports blue/green zero downtime updates with Elastic IPs and ELBs.
You can find a tutorial here: https://boxfuse.com/blog/javaee-aws.html
You don't have to worry about maintaining changes to the meta-data as all instances are immutable and contain all necessary app server info.
Disclaimer: I am the founder and CEO of Boxfuse

Categories