Help Center/ Auto Scaling/ Best Practices/ Deploying an HA Compute Cluster Using the Balanced Policy
Updated on 2025-07-16 GMT+08:00

Deploying an HA Compute Cluster Using the Balanced Policy

Scenarios

An HA compute cluster is needed in scenarios such as distributed big data compute, AI training, or traffic surges. Auto Scaling can automatically batch create ECSs and evenly distribute them across multiple AZs using the Balanced policy. Auto Scaling also monitors the status of ECSs in real time to ensure the high availability (HA) of the cluster.

Advantages

  • Zero O&M cost

    With Auto Scaling, ECSs can be automatically scaled in or out without manual intervention.

  • HA

    The Balanced policy can automatically distribute ECSs across AZs. This prevents capacity expansion failures caused by insufficient inventory in a single AZ. Health check is enabled by default to ensure that all ECSs in an AS group are running properly.

This section describes how to use Auto Scaling to evenly distribute ECSs across AZs and deploy an HA compute cluster.

Step 1: Create an AS Configuration

  • Evaluate service modules based on your service architecture and create an AS group for the service module that requires an HA compute cluster.
  • Prepare a custom image with service applications deployed. When configuring the desired AS configuration, select the custom image to ensure that the automatically created ECSs meet the requirements. For details, see Creating a Full-ECS Image from an ECS.
  1. Log in to the management console.
  2. Under Compute, click Auto Scaling. In the navigation pane on the left, choose Instance Scaling.
  3. Click Create AS Configuration and configure parameters as instructed.

    This section uses the following parameters as an example. Retain the default values for the parameters that are not listed. For details, see Using a New Specifications Template to Create an AS Configuration.

    Table 1 Parameters for configuring the AS configuration

    Parameter

    Example Value

    Description

    Name

    as-config-test

    Enter a name for the AS configuration as instructed.

    Billing Mode

    Pay-per-use

    Pay-per-use is a post-paid charging mode, so the total expenditures depend directly on ECS usage frequency and duration.

    You can create or delete your ECSs at any time.

    Flavor

    s3.small.1

    Set the vCPU and memory of the ECSs to be created.

    Image

    test

    Select an image used to deploy ECSs.

    You are advised to select the custom image where you have deployed your applications.

    System Disk

    General Purpose SSD, 100 GiB

    Select a system disk for ECSs based on service requirements.

    Security Group

    sg-bp18kz60mefsicfg****

    Select the security group you have created. For details about how to create a security group, see Creating a Security Group.

  4. Click Create Now.

Step 2: Create an AS Group

  1. On the Instance Scaling page, click Create AS Group.
  2. Configure parameters as instructed.

    This section uses the following parameters as an example. Retain the default values for the parameters that are not listed. For details, see Creating an AS Group.

    Table 2 Parameters for configuring the AS group

    Parameter

    Example Value

    Description

    Name

    test

    Enter the AS group name as instructed.

    AZ

    AZ1, AZ2, AZ3

    Select the AZs where ECSs will be deployed.

    Multi-AZ Scaling Policy

    Balanced

    This parameter is mandatory when two or more AZs are selected.

    Min. Instances

    10

    Set the minimum number of instances in an AS group. If the number of instances in an AS group is less than the minimum number, the AS group will automatically add instances until the number of instances reaches the minimum number.

    Max. Instances

    120

    Set the maximum number of instances in an AS group. If the number of instances in an AS group exceeds the maximum number, the AS group will automatically remove instances until the number of instances reaches the maximum number.

    Expected Instances

    10

    Specifies the expected number of ECSs in an AS group. After the creation, you can change this value. However, changing this value will trigger a scaling action. The value cannot be less than the number of minimum instances or greater than the number of maximum instances.

    AS Configuration

    as-config-test

    Select the AS configuration you created for the AS group.

    VPC

    Vpc-test

    All ECSs in the AS group are deployed in this VPC.

    Subnet

    Subnet-test

    A maximum of five subnets can be selected. The AS group automatically attach all NICs to the created ECSs.

    By default, the first subnet you select is used as the primary NIC of the ECS, and other subnets are used as the extension NICs.

    Health Check Method

    ECS health check

    Checks the ECS status. If an ECS is stopped or deleted, it is considered to be unhealthy.

    Health Check Interval

    5 minutes

    Specifies the health check interval of the AS group. You can set a health check interval, such as 10 seconds, 1 minute, 5 minutes, 15 minutes, 1 hour, or 3 hours, based on service requirements.

  3. After setting the parameters, click Create Now.
  4. Back to the AS group list. The AS group is successfully created if its status is Enabled.

Result

The minimum number of instances in the AS group is set to 10. After the AS group is enabled, the AS group automatically deploys 10 ECSs evenly in the selected AZs to form a compute cluster. The AS group ensures the cluster HA and reduces resource costs in the following ways:

  • If the inventory is insufficient in an AZ, the system automatically attempts to deploy ECSs in other AZs to reduce impact on services.
  • The AS group automatically removes unhealthy ECSs and creates new ECSs.