All Products
Search
Document Center

Server Load Balancer:Create and manage a vServer group

Last Updated:Feb 20, 2024

This topic describes how to create a vServer group for a Classic Load Balancer (CLB) instance. You can create vServer groups for CLB to distribute different requests to different backend servers. To allow CLB to distribute requests based on domain names or URLs, you can specify vServer groups in domain name-based forwarding rules or URL-based forwarding rules.

Background information

Before you create a vServer group, take note of the following items:

  • The Elastic Compute Service (ECS) instances that you add to a vServer group must be deployed in the same region as the CLB instance.

  • An ECS instance can be added to one or more vServer groups.

  • A vServer group can be associated with one or more listeners of a CLB instance.

  • When you add an ECS instance in a virtual private cloud (VPC) to an Internet-facing CLB instance, make sure that the VPC and the CLB instance are in the same region. When you add multiple ECS instances to an Internet-facing CLB instance, make sure that the ECS instances are in same VPC.

Prerequisites

Before you create a vServer group, make sure that the following requirements are met:

  • A CLB instance is created. For more information, see Create and manage a CLB instance.

  • ECS instances are created and applications are deployed on the ECS instances to receive requests. For more information, see the following topics:

    Note

    Make sure that the ECS instances and the CLB instance are in the same region.

Create a vServer group

  1. Log on to the CLB console.

  2. On the Instances page, select the region where the CLB instance that you want to manage is deployed.

  3. Click the ID of the CLB instance that you want to manage.

  4. Click the vServer groups tab and click Create vServer Group.

  5. On the Create vServer Group page, configure the following parameters:

    1. In the vServer Group Name field, enter a name for the vServer group.

    2. Enter a tag key in the Tag Key field and a tag value in the Tag Value field.

    3. In the Selected Servers section, click Add.

  6. In the Servers panel, select an ECS instance and click Next.

    • Select ECS instances

      Select ECS/ENI and select the ECS instances that you want to add.

      If no ECS instance is available, click Purchase ECS Instance in the upper-right corner of the instance list.

    • Select elastic network interfaces (ENIs)

      1. Select ECS/ENI and turn on Advanced Mode.

      2. Click the Add icon to the right of the ECS instance ID and select the ENI that you want to add.

        • If you want to select an ENI, make sure that the ENI is attached to the ECS instance. For more information, see Add backend servers by specifying ENIs.

        • If no ECS instance is available, click Purchase ECS Instance in the upper-right corner of the instance list.

  1. In the Ports/Weights step, specify a port and a weight for each server, and then click Add.

    • Port: Specify the backend port that the ECS instance uses to receive requests.

      ECS instances added to a CLB instance can use the same port.

    • Weight: A server that has a higher weight receives more requests.

      Important

      Valid values: 0 to 100. If the weight of a backend server is set to 0, no requests are sent to the backend server.

    You can click 批量操作 to specify ports and weights for all servers in the vServer group.

    • Replicate to Below: The ports or weights of all servers below the current server are set to the port or weight of the current server.

    • Replicate to Above: The ports or weights of all servers above the current server are set to the port or weight of the current server.

    • Replicate to All: The ports or weights of all servers in the vServer group are set to the port or weight of the current server.

    • Reset:

      • Reset to the right of Port: The ports of all servers in the vServer group are cleared.

      • Reset to the right of Weight: The weights of all servers in the vServer group are set to the default value.

  2. Confirm the configurations and click Create. In the message that appears, click OK.

    Note

    Click Add More below Selected Servers to add additional ECS instances.

Modify a vServer group

After you create a vServer group, you can modify the configurations of ECS instances in the vServer group.

  1. Log on to the CLB console.

  2. On the Instances page, select the region where the CLB instance that you want to manage is deployed.

  3. Click the ID of the CLB instance that you want to manage.

  4. Click the vServer groups tab.

  5. Find the vServer group that you want to manage and click Modify in the Actions column.

  6. On the Modify vServer Group page, modify the information about the vServer group and click Save.

    • You can rename the vServer group.

    • You can modify the ports and weights of the ECS instances in the vServer group.

    • You can click Delete to remove an ECS instance from the vServer group.

      Note

      If the ECS instance is associated with a listener or a forwarding rule, disassociate the listener or forwarding rule from the ECS instance before you remove the ECS instance.

    • Click Add More. In the Servers panel, you can add additional ECS instances to the vServer group.

Delete a vServer group

If you no longer use a vServer group to receive requests, you can delete the vServer group.

  1. Log on to the CLB console.

  2. On the Instances page, select the region where the CLB instance that you want to manage is deployed.

  3. Click the ID of the CLB instance that you want to manage.

  4. Click the vServer groups tab.

  5. Find the vServer group that you want to delete and click Delete in the Actions column.

    Note

    If the vServer group is associated with a listener or a forwarding rule, disassociate the listener or forwarding rule from the vServer group before you delete the vServer group.

  6. In the message that appears, click OK.

References