Вопрос

The general problem I am trying to solve is: "how to redeploy the web application without having users stop using the app during upgrade to the new version". I came up with following hypothetic scenario for the solution:

  1. Production environment for web app has a configured web server (IIS or maybe Apache) and will be running 2 identically configured JBoss instances.

  2. First, Web Server redirects all requests to one JBoss instance, running current version of our web app.

  3. New version of web app is ready to be deployed to production.

  4. We deploy new version to second instance of JBoss (while first instance is still running the old version of web app)

  5. Then, we somehow configure web server to redirect all new HTTP sessions to the second JBoss instance with the new version of web app.

  6. Currently active sessions are still redirected to "old" JBoss instance until a user logs out or session expires.

  7. For another version redeployment we follow the same procedure (but deploying to first instance while keeping second running old version).

Currently I don't know if this scenario makes any sense, my googling on the topic always ended in JBoss cluster configuration, which, in my opinion, is an overshoot in this case as we are not in high need of cluster HA solution (at least right now), also application was written without any clustering support in mind, which could be a real problem.

Please give me some hints on the topic. I would also appreciate greatly if someone has solved similar problems. Any advice on whether I am missing something in this description would also be desirable.

Это было полезно?

Решение

First of all, what you ask for is a HA scenario -- high availability during the application upgrade. The steps you provided actually looks good. It seems that you have put lots of thought on it. But the key is how to do step 5 and step 6.

I do not know if any web server has the capability to do what you ask for, but load balancer such as F5 should do the trick. In the load balancer, you can configure a pool of servers. Let's say at the very beginning there is only one server (server 1) in the pool serving the request. Then you add server 2 to the pool. Server 2 should be deployed with the upgrade app. Then you instruct load balancer not to send new requests to server 1, but keep connections with all the existing users. All new requests go to server 2. After all the old sessions are done on server 1, you take it out of pool.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top