Thursday, June 19, 2014

WebLogic Deployment Modes


Weblogic Server provides three types of application deployment staging modes which determines how deployment files are made available to target servers that must deploy deployment files or deployment units (an application or stand-alone module.)

  1. stage
  2. nostage
  3. external_stage

Most deployments use either stage or nostage modes and external_stage is least common deployment staging mode

Stage Mode Deployment

In stage mode, the Administration Server copies the deployment files or deployment source units from their original location on the Administration Server machine to the staging directories of each target server.

The staging directory is named "stage" by default, and it resides under the target server’s root directory. The target servers then deploy using their local copy of the deployment files.

For example, if you deploy a Java EE Application (ex:shoppingcart application) to two servers in a cluster using stage mode, the Administration Server copies the deployment files to directories on each of the two server machines. Each server then deploys the Java EE Application using its local copy of the archive files.
While copying deployment files, the Administration Server creates a sub-directory with the same name as the deployment name under the stage directory and copies the files.

The Administration Console uses stage mode as the default mode when deploying to more than one WebLogic Server instance. weblogic.Deployer uses the target server’s staging mode as the default, and Managed Servers use stage mode by default.

When to use Stage Mode Deployment:
  • Stage mode ensures that each server has a local copy of the deployment files on hand, even if a network outage makes the Administration Server unreachable.
  • If you are deploying small or moderate-sized applications to multiple WebLogic Server instances or Cluster

nostage mode deployment

In this mode, the Administration Server does not copy deployment unit files. Instead, all servers deploy using the same physical copy of the deployment files (from a shared or network-mounted directory), which must be directly accessible by the Administration Server and target servers.

The staging directory of target servers is ignored for nostage deployments.

By using Administration Console you can deploy the applications in nostage mode by selecting"I will make the deployment accessible from the following location". The Administration Console uses nostage mode as the default when deploying only to the Administration Server

When to use nostage Mode Deployment

  • Deploying to a single-server domain
  • Deploying applications to multiple targets or to a cluster where deployment files are available on a shared or network-mounted directory
  • When you are deploying very large applications (large in size), consider nostage mode to avoid the overhead of copying large files to multiple servers
  • Deploying exploded archive directories that you want to periodically redeploy after changing conten as in nostage mode, WebLogic Server copies out parts of the deployment to temporary directories. This enables users to update entire archived deployments or parts of archived deployments.
  • In nostage mode, the Web application container automatically detects changes to JSPs and servlets. Nostage also allows you to later update only parts of an application by updating those parts in one file system location and then redeploying.

Note: Deploying very large applications in nostage mode saves time during deployment because no files are copied.

external_stage mode deployment

The Administration Server does not copy deployment files. Instead, the Administrator must ensure that deployment files are copied/distributed (manually or using automated scripts or thirdparty tools)
to the correct staging directory location before  deployment.  With external_stage deployments, the Administration Server requires a copy of the deployment files for validation purposes.
You can perform the copy manually or use automated scripts.

First you need to create a "stage" directory under target server’s root directory.
Create a sub-directory with the same name as the application deployment name under the above created stage directory
Copy the deployment source files in the above created sub-directory

When to use external stage Mode Deployment
  • When you do not have a shared file system and if you you are deploying very large applications to multiple targets which are on different machines then using external stage is suggested as  it decreases the deployment time because files are not copied during deployment
  • Deployments where you want to manually control the distribution of deployment files to target servers.
  • Deploying to domains where third-party tools or scripts manage the copying of deployment files to the correct staging directories.