How do I deploy my Java WAR file on a production server without any downtime. I currently use Apache2 -> Jetty6 when I need to update the web application I unzip the war into the directory then restart the Jetty Service
/etc/init.d/jetty6 restart
This can take 5 minutes to restart is there another way? How do "big" websites do it?
In my experience hot deployment such as JBoss fails because the Garbage Collector doesn't collect everything and the service/process runs out of memory of has the situation improved?
How about this. Create a script that does the following:
You have the following things to take care:
To keep the sessions across the restart of the application you will need a central place to keep the session, that is outside the application. E.g. 2 database with replication or memcached with replication.
For database changes you will have to make sure that the new application is pointing to a database with then new structure only. Do not remove fields or make the new structure to be incompatible with the old application. E.g. do not remove attributes or change their type.
Configure apache to use load balancing with 2 application servers (that could run on the same server). Use session stickiness. When one of the server is deployed the other can answer the requests.
Big sites are using a distributed AS with clusters of servers, round robin DNS, load balancers...