I am not a programmer, but would like to know how the following task can be performed. I am working with an experienced developer and would like help from the programming community. If you can guide us or provide as a script, that will be awesome (and thank you ahead of time!)
Here is the scenario:
I have a JAVA application running on Tomcat 7 at Amazon’s cloud EC2 instance (Linux).
I do not want any downtime for the web application (or very little).
What I want is if the web application crashes due to any reason, for it to get auto-restarted immediately as I try to find the cause of the crash.
Please note the scenario that we are trying to deal with: Tomcat is still running, but the web application is down. So you can’t check for Tomcat being down as a parameter to restart the application
I don’t know enough about EC2 to fully answer this (and I only have a few minutes before work) but if it’s running in a scriptable environment and you can setup a cron job, it should be pretty easy.
Obviously, your best option is to write an app that doesn’t crash 🙂 But in the meantime, that could help and a canary page with some of your app’s configuration info is generally very useful.
Sorry I don’t have in depth details, but maybe some others could post in on the comments (or I will when I get back from work)
Also, Tomcat / Java EE offers a ton of bullet proof error handling so it should be rare that your app goes down. Are you sure your developer knows what he’s doing?