The scale up and scale down actions are used to start or stop running dynamic server instances in a dynamic cluster during scaling operations.
Elastic actions are associated with policies. As a policy's conditions are met, the elastic action is triggered and the scaling operation begins. This type of scaling is called policy based scaling. See Policy-Based Scaling.
Only one elastic action can be assigned to a policy. However, any number of non-scaling actions can be assigned to a policy, and elastic actions can be used in conjunction with non-scaling actions.
Note:
To configure automated elasticity for a dynamic cluster, you must create a domain-scope diagnostic system module in which you define the scaling policies, along with their corresponding elastic actions, and then target that diagnostic module to the Administration Server.
See Configuring Policies and Actions in Configuring and Using the Diagnostics Framework for Oracle WebLogic Server for information on the Policies and Actions component of WLDF.
When an associated policy is triggered, the scale up action adds running dynamic server instances to the specified dynamic cluster.
Example 5-1 shows a scale up action that will scale a dynamic cluster up by one running dynamic server instance.
Example 5-2 shows how to create and configure the scale up action shown in Example 5-1 using WLST. This scale up action is used as part of the policy-based scaling demo in Policy-Based Scaling Example.
Example 5-1 Sample Configuration for a Scale Up Action (in DIAG_MODULE.xml)
<wldf-resource> <name>ClusterManager</name> <watch-notification> <!-- One or more policy configurations --> <scale-up-action> <name>scaleUp</name> <cluster-name>DynamicCluster</cluster-name> <scaling-size>1</scaling-size> </scale-up-action> <!-- Other action configurations --> </watch-notification> </wldf-resource>
Example 5-2 Configuring a Scale Up Action
startEdit() scaleUp=wn.createScaleUpAction('scaleUp') scaleUp.setScalingSize(1) scaleUp.setClusterName(DynamicCluster) save() activate()
When an associated policy is triggered, the scale down action shuts down running dynamic server instances in the specified dynamic cluster.
Example 5-3 shows a scale down action that will scale down a dynamic cluster by one dynamic server instance.
Example 5-4 shows how to create and configure the scale down action shown in Example 5-3. This scale down action is used as part of the policy-based scaling demo in Policy-Based Scaling Example.
Shutting down server instances during a scale down operation can take a significant amount of time if there are, for instance, unreplicated sessions. Until they time out, the server instance will not shut down.
To reduce the time it takes to complete a scale down operation, the following DynamicServersMBean
attributes are used:
DynamicClusterShutdownTimeoutSeconds
IgnoreSessionsDuringShutdown
WaitForAllSessionsDuringShutdown
By specifying a timeout period or ignoring sessions during server shutdown, the shutdown time can be limited. However, remaining sessions may be lost. See Table 3-1 for descriptions of these attributes.
Example 5-3 Sample Configuration for a Scale Down Action (in DIAG_MODULE.xml)
<wldf-resource> <name>ClusterManager</name> <watch-notification> <!-- One or more policy configurations --> <scale-down-action> <name>scaleDown</name> <cluster-name>DynamicCluster</cluster-name> <scaling-size>1</scaling-size> </scale-down-action> <!-- Other action configurations --> </watch-notification> </wldf-resource>
Example 5-4 Configuring a Scale Down Action
startEdit() scaleDown=wn.createScaleDownAction('scaleDown') scaleDown.setScalingSize(1) scaleDown.setClusterName(DynamicCluster) save() activate()
Shutting down server instances during a scale down operation can take a significant amount of time if there are, for example, unreplicated sessions. Until those unreplication sessions time out, the server instance is not shut down.
To reduce the time it takes to complete a scale down operation, you can configure the following DynamicServersMBean
attributes:
DynamicClusterShutdownTimeoutSeconds
IgnoreSessionsDuringShutdown
WaitForAllSessionsDuringShutdown
By specifying a timeout period or ignoring sessions during server shutdown, the shutdown time can be reduced. However, remaining sessions may be lost. See Configuring Dynamic Clusters for descriptions of these attributes.
The WebLogic Server documentation includes several topics to help you learn how to configure the elastic scaling actions using either the WebLogic Server Administration Console or Fusion Middleware Control.
Table 5-1provides the roadmap for creating and configuring elastic actions.
Table 5-1 Elastic Actions Roadmap
For more information on... | See... |
---|---|
Creating actions in the WebLogic Server Administration Console |
Create actions for policies in a diagnostic system module in the Oracle WebLogic Server Administration Console Online Help |
Creating elastic actions in the WebLogic Server Administration Console |
Create a scale up action and Create a scale down action in the Oracle WebLogic Server Administration Console Online Help |
Configuring elastic actions in the WebLogic Server Administration Console |
Configure a scale up action and Configure a scale down action in the Oracle WebLogic Server Administration Console Online Help |
Creating elastic actions in Fusion Middleware Control |
Create a scale up or scale down action in Administering Oracle WebLogic Server with Fusion Middleware Control |
Configuring elastic actions in Fusion Middleware Control |
Configure a scale up action and Configure a scale down action in Administering Oracle WebLogic Server with Fusion Middleware Control |