Deploying to a Cluster Target Enforcing Consistent Deployment to All Configured Cluster Members

6-6 Deploying Applications to Oracle WebLogic Server -password weblogic -deploy -targets companyHost c:\localfiles\myWebApp.ear Specify multiple targets using a comma-separated list, as in: java weblogic.Deployer -adminurl http:localhost:7001 -username weblogic -password weblogic -deploy -targets ManagedServer-1,ManagedServer-2 c:\localfiles\myapp.ear

6.6.3 Deploying to a Cluster Target

If you specify a cluster target using -targets mycluster, WebLogic Server targets all server instances in the cluster by default. This corresponds to homogenous module deployment, which is recommended in most clusters. If you want to deploy a module only to a single server in the cluster that is, pin a module to a server, specify the individual server instance name, rather than the cluster, as the target. This type of deployment is less common, and should be used only in special circumstances where pinned services are required. See Understanding Cluster Configuration and Application Deployment in Using Clusters for Oracle WebLogic Server for more information. When you deploy an application to a cluster target, WebLogic Server ensures that the deployment successfully deploys on all available members of the cluster. If even a single, available WebLogic Server instance in the cluster cannot deploy the application, the entire deployment fails and no servers in the cluster start the application. This helps to maintain homogeneous deployments to the cluster, because deployment operations succeed or fail as a logical unit. If a clustered server is unreachable at the time of deployment for example, because of a network failure between the Administration Server and a Managed Server, or because a cluster member is shut down that server does not receive the deployment request until the network connection is restored. This default behavior ensures that most deployment operations succeed, even when servers are taken offline.

6.6.4 Enforcing Consistent Deployment to All Configured Cluster Members

The default cluster deployment behavior ensures homogeneous deployment for all clustered server instances that can be reached at the time of deployment. However, if the Administration Server cannot reach one or more clustered servers due to a network outage, those servers do not receive the deployment request until the network connection is restored. For redeployment operations, this can lead to a situation where unreachable servers use an older version of the deployed application, while reachable servers use the newer version. When the network connection is restored, previously-disconnected servers may abruptly update the application as they receive the delayed redeployment request. It is possible to change WebLogic Servers default deployment behavior for clusters by setting the ClusterConstraintsEnabled option when starting the WebLogic Server domain. The ClusterConstraintsEnabled option enforces strict deployment for all servers configured in a cluster. A deployment to a cluster succeeds only if all members of the cluster are reachable and all can deploy the specified files. Note: Pinning a deployment to a subset of server instances in a cluster rather than to a single server on the cluster is not recommended and will generate a warning message. Deploying Applications and Modules with weblogic.Deployer 6-7 To set the ClusterConstraintsEnabled for the domain when you start the Administration Server, include the appropriate startup argument: ■ -DClusterConstraintsEnabled=true enforces strict cluster deployment for servers in a domain. ■ -DClusterConstraintsEnabled=false ensures that all available cluster members deploy the application or module. Unavailable servers do not prevent successful deployment to the available clustered instances. This corresponds to the default WebLogic Server deployment behavior.

6.7 Using Module-Level Targeting for Deploying an Enterprise Application