A Server Load Balancer (SLB) is a traffic distribution control service that distributes traffic based on forwarding rules and scheduling algorithms to multiple backend servers. For more information, see What is Server Load Balancer.
You can create an Internet-facing SLB instance, and add VPC ECS instances as the backend servers to process the distributed requests from the Internet. In this way, the VPC ECS instances can provide external services.
Two ECS instances with Apache static web pages deployed are used in this tutorial.
Log on to the Server Load Balancer console and click Create Server Load Balancer to create an Internet-facing SLB instance.
A public IP address is allocated to the SLB instance after it is created. You can use this IP address to provide external services.
Add backend servers.
Click the ID of the created SLB instance.
In the left-side navigation pane, click Server > Backend Server.
Click the Servers Not Added tab.
Select the checkboxes next to the VPC ECS instances and then click Add in Batch. In the pop-up dialog, set the weight to 100 and click Confirm to add.
Add a listener.
In the left-side navigation pane, click Listener, and then click Add Listener.
In the Add Listener dialog, refer to the following figure to configure the TCP listener.
Click Next Step to configure the health check and select TCP with other settings unchanged. Click Confirm twice to finish the configuration.
Go back to the Server Load Balancer list page and refresh the page to check the instance status. When the instance is running and the health check is normal, you can use the public IP address of the SLB instance to provide external services.