2 Requirements for Configuring Elasticity

To configure elasticity for a dynamic cluster in Oracle WebLogic Server, you must have a dynamic cluster for which you specify a set of key attributes related to scalability, such as the initial, minimum, and maximum number of dynamic server instances that can be running.And depending on your scalability needs, you can have additional tasks, such as provisioning machines, configuring database resources, creating policies that automate scaling operations when certain conditions arise, and more.

This chapter includes the following sections:

Configuring Dynamic Clusters

Elasticity is only available for use with dynamic clusters. Before configuring elastic scaling, you must create and configure a dynamic cluster. See Creating and Configuring Dynamic Clusters in Administering Clusters for Oracle WebLogic Server.

Table 2-1 explains the DynamicServersMBean attributes that are used to configure a dynamic cluster for elasticity.

Table 2-1 Attributes for Configuring Elasticity in Dynamic Clusters

Attribute Description

DynamicClusterCooloffPeriodSeconds

The cool-off period, in seconds, used during scaling operations. After a scaling operation is performed, subsequent requests for scaling operations will be ignored during this cool-off period. The default value is 900 and the minimum value is 0.

DynamicClusterShutdownTimeoutSeconds

The timeout period, in seconds, use while gracefully shutting down a dynamic server instance. If the dynamic server instance does not shut down before the specified timeout period, it will be forcibly shut down. The default value is 0.

DynamicClusterSize

The initial number of dynamic server instances to be provisioned in the dynamic cluster. The minimum value for this attribute is 0 and the maximum value is 800.

IgnoreSessionsDuringShutDown

Indicates if the Elasticity Framework should ignore inflight HTTP requests while shutting down dynamic server instances during scale down operations.

MaxDynamicClusterSize

The maximum number of dynamic server instances that can be used in scaling operations. The default value for MaxDynamicClusterSize is 8. The minimum value is 0 and the maximum value is 800.

Note that if a scale up operation attempts to exceed the limit set in MaxDynamicClusterSize, the operation will not fail, but WebLogic Server will only add running dynamic server instances until this limit is reached.

MinDynamicClusterSize

The minimum number of running dynamic server instances that the Elasticity Framework will attempt to keep in the dynamic cluster during scaling operations. The default value is 1. The minimum value is 0 and the maximum value is 800.

Note that, during a scale down operation, any attempt to scale down below the limit set in MinDynamicClusterSize is not allowed. WebLogic Server will only scale down to this limit.

WaitForAllSessionsDuringShutdown

Indicates if the Elasticity Framework should wait for all persisted and non-persisted inflight HTTP sessions while shutting down dynamic server instances during scaling operations.

You can set these attributes and configure your dynamic cluster for elasticity using the WebLogic Server Administration Console, the Fusion Middleware Control component of Enterprise Manager (EM), or WebLogic Scripting Tool (WLST). For information about using the WebLogic Server Administration Console, see Configure elasticity for a dynamic cluster in the Oracle WebLogic Server Administration Console Online Help. For information about using Fusion Middleware Control, see Configure clusters in Administering Oracle WebLogic Server with Fusion Middleware Control.

Example 2-1 demonstrates how to use WLST to define dynamic cluster attributes for elasticity in an existing dynamic cluster.

Example 2-2 demonstrates how to create and configure a dynamic cluster for elasticity. This dynamic cluster is used in the policy based scaling demonstration in Policy-Based Scaling Example.

Example 2-1 Configuring a Dynamic Cluster for Elasticity

startEdit()
cmo.setDynamicClusterSize(4)
cmo.setMaxDynamicClusterSize(8)
cmo.setMinDynamicClusterSize(2)
cmo.setDynamicClusterCooloffPeriodSeconds(120)
save()
activate()

Example 2-2 Creating and Configuring a Dynamic Cluster

edit()
startEdit()

dynCluster=cmo.createCluster(DynamicCluster)
  
  dynServers=dynCluster.getDynamicServers()
  dynServers.setServerTemplate(dynamicServerTemplate)
  dynServers.setMinDynamicClusterSize(2)
  dynServers.setMaxDynamicClusterSize(8)
  dynServers.setDynamicClusterSize(4)
  dynServers.setDynamicClusterCooloffPeriodSeconds(120)
  dynServers.setCalculatedListenPorts(true)
  dynServers.setCalculatedMachineNames(true)
  #
  # Dynamic server names will be dynamic-server-1, dynamic-server-2, ...,
  # dynamic-server-10.
  #
  dynServers.setServerNamePrefix(dynamic-server-)

save()
activate()

Configuring Policies and Actions

In policy-based scaling, a policy sets the conditions under which a scaling operation must occur. And when these conditions are met, an elastic action performs the scaling operation. To configure policy-based scaling of a dynamic cluster, you create a diagnostic system module that contains one or more policies, and then assign an elastic action (scale up or scale down) to each of those policies. For information on the Policies and Actions component of WLDF, see Configuring Policies and Actions in Configuring and Using the Diagnostics Framework for Oracle WebLogic Server.

To use the WebLogic Server Administration Console to create and configure policies and actions in a diagnostic system module, see Configure policies and actions in the Oracle WebLogic Server Administration Console Online Help. To use Fusion Middleware Control, see Create and configure policies and actions in Administering Oracle WebLogic Server with Fusion Middleware Control.

Targeting the Diagnostic System Module

After you have defined the policies and elastic scaling actions in a diagnostic system module, you must target that diagnostic system module to the Administration Server.

Some of the smart rules and scaling actions used for elasticity must execute from the Administration Server so that they can have visibility across the dynamic cluster. As a result of this, diagnostic system modules intended for elastic scaling of dynamic clusters must be targeted to the Administration Server. If such a module is targeted to the cluster itself, or to an individual Managed Server, errors are generated and the policies and actions are consequently ignored by WLDF.

Provisioning Machines

To configure policy-based elastic scaling, you must appropriately provision machines for the maximum necessary scale-up capacity.