Anshul Archive

Side by Side deployment/Versioning

Production redeployment of application/ versioning/ side by side deployment

We need versioning for updating the application in production on runtime. The sessions which are already logged in will be using the previous version of the application and the new sessions created will use the new version of application.

1)In the application, Version-1 in MANIFEST.MF we need to add the following:

Manifest-Version: 1.0

Created-By: 1.5.0_04 (Sun Microsystems Inc.)

Weblogic-Application-Version: Version-1

Version-2 MENIFEST-MF

Manifest-Version: 1.0

Created-By: 1.5.0_04 (Sun Microsystems Inc.)

Weblogic-Application-Version: Version-1

2. Open a command window and browse to your domain bin directory.

3. start Admin server using Startweblogic.cmd.

4. Type setdomainenv.cmd to set your weblogic Domain.

5.Now to deploy the first version run the following command (please change as per your specifications):

C:\bea9.1\user_projects\domains\base_domain>java weblogic.Deployer -appversion 1 -adminurl http://127.0.0.1:7001 -username weblogic -password weblogic -deploy -name deployment_name -source c:/…/ -targets AdminServer

6. Now to Redeploy use the following command:

C:\bea9.1\user_projects\domains\base_domain>java weblogic.Deployer -appversion 2 -adminurl http://127.0.0.1:7001 -username weblogic -password weblogic -redeploy -name deployment_name -source c:/…/ -retiretimeout 120

 

7. We will get the version -1 application in retiring state in the console. The requests which were handled previously by this application will be handled by this version.

8. Version-2 application will have ACTIVE status and will be accepting new requests coming in to the application.

 

Reference:

http://download.oracle.com/otn_hosted_doc/wls/redeployment/wls-side-by-side-non-annotation_viewlet_swf.html

Configuration: WLDF Mail Notification for Runtime Mbean

Weblogic Diagnostics Framework can be used to analyze, collect, archive and access diagnostic data generated by a running server and the applications deployed within its containers.

Here I have provided configuration for sending mail notification on the harversted data for the runtime Mbean which you want to monitor.

1. From <domain_name> -> Diagnostics -> Diagnostics Module Create a diagnostic module and target it to server for which WLDF module has to be used.


<domain_name>

<domain_name>

<domain_name>

2.

For the Diagnostics module created in step 1, create a Collection metrics for mbean you want to monitor:

a) Click on ‘New’ to create a Collection Metrics

b) Select the Mbean Server location for which we want to collect data. It can be DomainRuntime or ServerRuntime Mbean.

c) Select the Mbean which has to be monitored

d) Select the Attributes which you want to collect for the Runtime Mbean selected in Step 2(c)

3) Create a mail session from Services -> Mail Session

a) Specify and JNDI name for mail session and the following as mail session properties:

mail.smtp.host=xxxxxxxx

mail.smtp.user=xxxxxxxxxxxxxx

b) Target the mail session to a server

4) Creating a Notification:

a) From Diagnostics -> Diagnostics Module -> Watches and Notification, Create a New Notification. Specify Notification Type as SMTP (email).Here Keep ‘Enable Notification’ as Checked and click ‘Next’

b) Here select the Mail session which we configured in Step 3 along with the Email Recipients who will be receiving the mail notification for Runtime mbean. Here we can edit the format of Email notification. Click Finish.

5) Create a Watch for Runtime mbean which was mentioned in Collection Metrics configured in Step 2 (Can be Server Log as well):

a) Select the Mbean location

b) Select Mbean to be monitored

c) Select instance for which the Mbean has to be monitored. (Only one instance can be selected at a time. Note: If we want to monitor Runtime Mbean for more than one instance then we can add expression selecting the same mbean for other servers. Refer Step 5-f)

d) Select the attribute for which watch has to be configured and apply desired operation to it. Attribute should be same as what we have configured in Collection Metrics.

f) Verify the Watch Rule Expression created from the previous steps followed. If you want the same mbean to be monitored for more than one server then click on ‘Add Expression’ tab follow steps 5-a through 5-e for other server instance. We can use ‘AND’/’OR’ operations to create Watch Rule as per requirement.

g) Select Alarm on the watch

h) Select the notification which we created in step 4 and Click Finish

After all the above setting we will get an email update if the condition mentioned in the watch rule is met.