Help Center> ServiceStage> User Guide> Application O&M> Setting Scheduling Policies for Application Component Instances

Setting Scheduling Policies for Application Component Instances

ServiceStage provides a variety of scheduling strategies, including static global scheduling strategies and dynamic runtime scheduling strategies. You can select or combine these strategies as required.

Precautions

When setting application component-node affinity and application component-application component affinity, ensure that the affinity relationships are not mutually exclusive; otherwise, application deployment will fail. For example, application deployment will fail when the following conditions are met:

  • Anti-affinity is configured for two application components. For example, one application component is deployed on one node and the second application component is deployed on another node.
  • When a third application component is deployed on a different node and goes online, affinity is configured between this application component and the second application component. As a result, affinity relationships are mutually exclusive, and the application component fails to be deployed.

Concepts

  • Application-AZ Affinity and Anti-Affinity:
    • Affinity with AZs: Application components can be deployed in specific AZs.
    • Non-affinity with AZs: Application components cannot be deployed in specific AZs.
  • Application-Node Affinity and Anti-Affinity:
    • Affinity with Nodes: Application components can be deployed on specific nodes.
    • Non-affinity with Nodes: Application components cannot be deployed on specific nodes.
  • Application-Application Affinity and Anti-Affinity: determines whether application components are deployed on the same or different nodes.
    • Affinity with Applications: Application components are deployed on the same node. You can deploy application components based on service requirements. The nearest route between application components is used to reduce network consumption. For example, the following figure shows affinity deployment, in which all applications are deployed on the same node.
      Figure 1 Application affinity
    • Anti-affinity with Applications: Different applications or multiple instances of the same application component are deployed on different nodes. Anti-affinity deployment for multiple instances of the same application reduces the impact of system breakdowns. Anti-affinity deployment for applications can prevent interference between the applications.
      As shown in the following figure, four applications are deployed on four different nodes. The four applications are deployed in anti-affinity mode.
      Figure 2 Application anti-affinity

Procedure

During or after application component deployment, you can go to the application details page, choose Upgrade and set scheduling policies.

When deploying an application component, expand Advanced Settings > Deployment Configuration and set the following parameters on the Scheduling Policy tab page:
Table 1 Setting affinity

Purpose

Procedure

Setting application component-AZ affinity

  1. Choose Scheduling Policy > Affinity and click Add an affinity object.
  2. Set the object type to Availability Zone, and select the desired AZ.
  3. Click OK.

Setting application component-AZ anti-affinity

  1. Choose Scheduling Policy > Anti-affinity and click Add anti-affinity objects.
  2. Set the object type to Availability Zone, and select the desired AZ.
  3. Click OK.

Setting application component-node affinity

  1. Choose Scheduling Policy > Affinity and click Add an affinity object.
  2. Set the object type to Node, and select the desired node.
  3. Click OK.

Setting application component-node non-affinity

  1. Choose Scheduling Policy > Anti-affinity and click Add anti-affinity objects.
  2. Set the object type to Node, and select the desired node.
  3. Click OK.

Setting application component-application component affinity

  1. Choose Scheduling Policy > Affinity and click Add an affinity object.
  2. Set the object type to Application, and select the desired applications.
  3. Click OK.

    The selected application components are deployed on the same node.

Setting application-application anti-affinity

  1. Choose Scheduling Policy > Anti-affinity and click Add anti-affinity objects.
  2. Set the object type to Application, and select the desired applications.
  3. Click OK.

    The selected application components are deployed on different nodes.