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:
NoteMake sure that the ECS instances and the CLB instance are in the same region.
Create a vServer group
Log on to the CLB console.
On the Instances page, select the region where the CLB instance that you want to manage is deployed.
Click the ID of the CLB instance that you want to manage.
Click the vServer groups tab and click Create vServer Group.
On the Create vServer Group page, configure the following parameters:
In the vServer Group Name field, enter a name for the vServer group.
Enter a tag key in the Tag Key field and a tag value in the Tag Value field.
In the Selected Servers section, click Add.
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)
Select ECS/ENI and turn on Advanced Mode.
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.
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.
ImportantValid 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.
Confirm the configurations and click Create. In the message that appears, click OK.
NoteClick 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.
Log on to the CLB console.
On the Instances page, select the region where the CLB instance that you want to manage is deployed.
Click the ID of the CLB instance that you want to manage.
Click the vServer groups tab.
Find the vServer group that you want to manage and click Modify in the Actions column.
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.
NoteIf 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.
Log on to the CLB console.
On the Instances page, select the region where the CLB instance that you want to manage is deployed.
Click the ID of the CLB instance that you want to manage.
Click the vServer groups tab.
Find the vServer group that you want to delete and click Delete in the Actions column.
NoteIf 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.
In the message that appears, click OK.
References
For more information about how to configure the default server group, see Add an ECS instance to the default server group.
For more information about how to configure a primary/secondary server group, see Create and manage a primary/secondary server group.