Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I only use Tomcat and the server goes down, what are my options to keep the application looking like it is running?

I am considering using an architecture with just one server which will be Tomcat (as opposed to Apache with Tomcat).

If Tomcat goes down or gets out of memory, what can I do to?

  1. Alert me of this in the fastest way?
  2. Make sure there is still some professional looking page when users try to access the application
  3. If possible, give myself some period of time to fix what happened without the users finding out?
like image 344
Genadinik Avatar asked Dec 09 '25 23:12

Genadinik


2 Answers

To check the service availability I recommend you to use Nagios.

Nagios have plugins that constantly checks for the state of the configured services, and emit alerts if there is a service interruption. Alerts could be sms, mails etc.

like image 71
jcarlosn Avatar answered Dec 12 '25 03:12

jcarlosn


  1. Regarding monitoring I agree with the other poster's suggestion of Nagios. However, Hyperic is a much more sophisticated solution to monitor Java programs, it comes preconfigured for Tomcat (look here) and hundreds of other programs so it's definitely worth a look. Hyperic can also mail you before the server OOMs, by monitoring the memory pools by the way.
  2. For 2 and 3 I'd put a reverse proxy/load balancer in front of several instances of Tomcat with your application (see clustering). Have a look at Pound for a nice, lightweight solution that can also do https wrapping, sticky sessions and more.
like image 35
fvu Avatar answered Dec 12 '25 04:12

fvu