Hot Deploy Java EAR to minimize or eliminate application downtime on the server?

I heard that this is what JavaRebel does, but is there another good way to deploy a new version of EAR, allowing users to stay active in the previous version? We use JBoss for the application server ...

+7
java deployment jboss
Oct 21 '08 at 13:17
source share
4 answers

This is not what JavaRebel does. JavaRebel (as described) hot-swaps classes in memory. This is unacceptable in the case of existing connections to the system, since updated classes can violate the client logic.

As soon as the company I worked with had a similar problem and it was resolved as follows:

  • An intelligent router was used as load balancing.
  • the new version has been deployed up to 50% of the nodes of the (new) cluster
  • new connections were delivered strictly to these updated nodes, old were balanced between the old nodes.
  • old nodes were disconnected (one by one to keep the number of clients per node within)
  • at the same time, the new version was deployed to stand-alone "old" nodes, and they were created as new nodes.
  • due to EJB clustering, sessions and beans were assembled by other old nodes
  • in the end (in a few hours) there is only one old node left, having one instance of the old version and all clients using the old version, with it
  • when the last old client disconnected that node was too down

Now I am not a network guy and can not give you a lot of details (for example, what is the equipment of the router, etc.). My understanding of this can be set up quite easily, except that, if I remember correctly, we had to configure an additional Weblogic domain to deploy new versions of the application (otherwise it would be contrary to the old JNDI name).

Hope this helps.

PS Ichorus made a comment saying the application is being deployed to client servers. Thus, a router trick may not be possible. Now I see only one viable solution right now (now 21:52, I may not notice things :)) -

  • Development of a new version with JNDI names with version; for example, if the client bean was under ejb / Customer in version 1, in version 2 it was under ejb / Customer2
  • You have a business facade in an application with a stable basic interface (Factory-style), which, when asked by the Customer bean, tries to find the highest JNDI name (not for every call, of course, it can cache for an hour or so). This facade could (and should) be deployed as a standalone application - and was never or very rarely updated
  • Now each new client will have access to deploy the latest application, and the applications will not conflict.

This approach requires careful planning and testing, but IMHO should work.

I recently changed several applications in the same way that they coexisted in the same domain (before they used the same JNDI name for different data sources).

+5
October 21 '08 at 19:02
source share

As I understand it, WebLogic has a feature called concurrent deployment to eliminate downtime when upgrading the EAR version. You can deploy the new version without stopping the existing application, and as soon as the new version is successfully deployed, you can transparently switch from the old to the new.

I am not sure if this supports another application server.

Link: http://edocs.bea.com/wls/docs100/deployment/redeploy.html#wp1022490 p>

+1
Oct 22 '08 at 9:22
source share

Vladimir’s suggestion regarding the use of load balancing is a pretty sure way to achieve what you want. Keep in mind that this does not have to be a high-performance load balancer. Rather, if you go to your JBoss server using your own web server (Apache or IIS) and mod_jk or mod_proxy, you can maintain one common web façade and implement the applicable load and routing procedures during the EAR upgrade.

// Nikolay

+1
Jan 04 '09 at 6:48
source share

I think you can look in Spring using OSGI. http://www.springframework.org/osgi

0
Oct 22 '08 at 2:27
source share



All Articles