What is Server Load Balancer ?
Alibaba Cloud Server Load Balancer is a traffic distribution control service that distributes the incoming traffic among multiple Elastic Compute Service (ECS) instances according to the configured forwarding rules. It expands the service capabilities of the application and increases the availability of the application.
By setting a virtual service IP address, Server Load Balancer virtualizes the ECS instances located in the same region into a high-performance and highly-available application service pool. Client requests are distributed to the ECS instances in the cloud server pool according to the defined forwarding rules.
Server Load Balancer checks the health status of the ECS instances in the cloud server pool and automatically isolates any ECS instances with an abnormal status. This eliminates the single point of failure (SPOF) of an ECS instance and improves the overall service capability. Additionally, Server Load Balancer also provides the capability of defending DDoS attacks, which enhances the security of the application.
Different Steps For Server Load Balancer
- Log in to your Alibaba Cloud Console.
- Under the Products and Services section, select Server Load Balancer.
- Select the same region as your previously launched ECS instances to check for any existing Server Load Balancer in this region. Select Create Load Balancer on the top right corner of the page.
- Make the appropriate selection for Region, Primary Zone, Backup Zone (if applicable), Instance Type, Public Bandwidth, and Quantity. Then, select Buy Now to confirm the order.
- Verify your selection on the next page and click Activate to activate the service.
You will need to configure the purchased Server Load Balancer instance before using it.
- On the management console, select Server Load Balancer.
- To change the name of your instance, place your cursor in the Server Load Balancer ID/Name column and click the Edit icon.
- Click Manage to modify the configurations of your instance.
- Select Listener in the left panel.
- Select Add Listener in the top-right corner to open the Add Listener dialogue box.
Note: One Server Load Balancer instance can have up to 50 listeners.
- Select TCP and set the frontend and backend ports to 80. Click Next Step to go to the Health Check Configuration tab.
Note: Server Load Balancer supports both Layer 4 (TCP, UDP protocol) and Layer 7 (HTTP, HTTPS protocols) load balancing.
- Click Expand Advance Options and set the parameters as shown in the figure below. Click Confirm to proceed.
- Click Confirm to close the dialogue box and return to the management console.
- In the left panel, navigate to Backend Server located under Server. Click the Servers Not Added tab to view all available servers.
- Click Add to add ECS instances onto Server Load Balancer.
- Set the Weight of your ECS instances. Click Confirm.
Note: If all instances are set to a weight of 100, the average forwarding rule is adopted. In this rule, the load is equally distributed to all servers.
- You will now see the two backend ECS instances added and displayed in the Servers Added tab.
- Visit the URL of the Server Load Balancer instance to verify successful installation. We have set up our ECS instances to host static websites.
Note: You will be forwarded to any one of the web pages hosted by the ECS instances since the traffic load is equally distributed. With that, you have successfully configured Server Load Balancer to manage your ECS instances!