Thursday, February 21, 2013

Side by Side Deployments (Rolling/Hot/InPlace Deployments)

One of the great features of ADF/Weblogic is side by side deployments. This allows you to deploy two different versions of an application to a Weblogic server without the need for an outage. Weblogic is smart enough deal with current and new session. Once the new version of the application has been deployed to the server the old version of the application set in to "Retired" status and the new version is set to "Active". The retired version of the application maintains any active sessions until they end (also has the option to expire all sessions immediately or after a set time period). Whilst the new active version of the application handles all the new sessions, this is quite a cool feature. I've used this a fair bit and it seems to work quite well. This only catch is if you are a deploying a large ear file the response times of the server do suffer.

Anyway, here is how you do it.

Firstly create a two test applications.

Create a MANIFEST.MF file and paste the following details inside. Take note of the Archive-Version, this is the version number that weblogic looks for when it decides to retire or promote the new application. 


You will need to create a new deployment profile.


Then define your new manifest file.


Then do the same as above but increment the Archive Version and do the above two steps to the second application.


In order to test that the side by side deployment worked. Deploy the first application and it should appear as 'Active' in the weblogic console, then deploy the second application and the first application should get set to 'Retired' and the new application will be set to 'Active'. 

To ensure that you don't have an outage you can test the site with a load testing too such as LoadUI as I did below. You can see an increase in response time when the second application is being deployed. In reality, it is Oracle's recommendation that you have the Admin Server running on a separate machine to your managed servers. So when you do a side by side deployment in "theory" you shouldn't see an increase in response times as you can in the below test.



2 comments:

  1. Awesome post dude. Now, how would i configure the app or weblogic to say: when a new app version comes in, keep the old running and have the new sitting in a ready state?

    ReplyDelete
    Replies
    1. Sorry, for the slow response. You'll need to deploy the application in stage mode if you want the new application deployed but not accessible.

      http://docs.oracle.com/cd/E13222_01/wls/docs90/config_scripting/reference.html#1024213

      Delete