This document provides steps for deploying applications using the Production Redeployment strategy with WebLogic Scripting Tool (WLST). Production Redeployment provides application users with 24x7, high availability access without interrupted services.

Solution

In this example we assume that we are deploying application names "survey_web.war" (attached to this note) to an Admin Server running on localhost and port 7001. The username and password will be weblogic/weblogic.
  1. Set WebLogic environment variables by running the setDomainEnv script.
     
  2. Connect to WLST offline mode using below command
    java weblogic.WLST
  3. Connect to the domain using below connect command (to go online):
    connect('weblogic','weblogic','t3://localhost:7001')
  4. Initial deployment and subsequent deployments must be accomplished by naming the deployment versions to ensure high availability and continuity of service:
    Please refer below OTN documentation for more details on options
    http://www.oracle.com/pls/as1111/lookup?id=WLSTC202

    For the first time you deploy application, deploy the application using version number in this example, we will take version number as 10-2.

    Syntax: deploy ('<application name>','<source location>', targets='<target server or cluster>', stageMode='<stage, no stage or external stage>', versionIdentifier='<application version>'
    deploy('survey_web','D:/survey_web.war', targets='AdminServer', stageMode='nostage', versionIdentifier='10-2')

    After deploying the application you can use application name with version number "survey_web (10-2)" in active state in console.
     
  5. To deploy the same application with some updates, deploy the application as below in WLST.

    Syntax: deploy('<application name>','<source location>', archiveVersion='<current version of application>', appVersion='<new version of application>')
    deploy('survey_web','D:/survey_web.war', archiveVersion='10-2', appVersion='10-3')

    The new version of application, 10-3 in this case, will be active and the older archiveVersion 10-2 will go into the retire state after deploying the application with WLST command. So you will have two versions of application: one in active state, and other in retired state.

    The version of the application in the retired state will serve all the existing requests. All new requests will be routed to version of application which is active.


0 Comments