You can attach Server Load Balancer (SLB) instances to a scaling group. The SLB instances distribute traffic to multiple Elastic Compute Service (ECS) instances in the scaling group, improving the performance of the scaling group.
- You have at least one SLB instance in the Running state. For more information, see Create an SLB instance.
- The SLB instance and the scaling group are in the same region.
- The SLB instance and the scaling group are in the same Virtual Private Cloud (VPC) network if their network type is VPC.
- If the network type of the SLB instance is classic network, the network type of the scaling group is VPC, and the back-end server group of the SLB instance contains VPC-connected ECS instances, then the ECS instances and the scaling group must be in the same VPC network.
- At least one listener is configured on the SLB instance. For more information, see Listener overview.
- Health check is enabled on the SLB instance. For more information, see Configure health check.
SLB allows multiple ECS instances in a region to share the service load through the IP address of an SLB instance. These ECS instances act as a high-performance and highly available application service pool. Simply put, SLB distributes and controls traffic by using SLB instances, listeners, and back-end ECS servers. For more information, see What is Server Load Balancer?.
This section focuses on operations for attaching an SLB instance to a scaling group in the Auto Scaling console. For more information about other configurations of a scaling group, see Create a scaling group.
- Log on to the Auto Scaling console.
- In the left-side navigation pane, click Scaling Groups.
- In the top navigation bar, select a region.
- Use either of the following methods to go to the page for attaching an SLB instance
to a scaling group:
- To create a scaling group, click Create Scaling Group.
- To modify a scaling group, find the target scaling group and click Edit in the Actions column.
- Set the network type.
The network type cannot be changed for a scaling group after it is created.
- Select the SLB instance to be attached to the scaling group.
You can only attach a limited number of SLB instances to a scaling group. For more information, see Limits. If your SLB instance does not appear in the drop-down list, check whether your SLB instance meets the prerequisites.
- Select back-end server groups for the SLB instance.
You can select the default server group and VServer groups. For more information, see Backend server overview.
- The default server group contains the ECS instances that receive requests forwarded by a listener. If no VServer group or primary/secondary server group has been specified for the listener, the listener forwards all requests to the ECS instances in the default server group.
- You can select VServer groups if you want to forward different requests to different back-end servers, or forward requests based on domain names or URLs. You can only attach a limited number of SLB instances to a scaling group. For more information, see Limits.
- Configure the remaining settings as needed.