This chapter includes the following sections:
The scale up and scale down actions are used to add or remove running dynamic server instances from a dynamic cluster during scaling operations.
Elastic actions can be 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. For more information on policy-based scaling, see Chapter 7, "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 those 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 scales up a dynamic cluster by one running dynamic server instance.
<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 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.
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 scales down a dynamic cluster by one dynamic server instance.
<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>
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
By specifying a timeout period or ignoring sessions during server shutdown, the shutdown time can be reduced. However, remaining sessions may be lost. See Table 3-1 for descriptions of these attributes.
You can also create and configure scale up and scale down actions using the WebLogic Server Administration Console or Fusion Middleware Control. See Table 5-1 for more information.
|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
Configuring elastic actions in the WebLogic Server Administration Console
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