How to Manage Traffic on Multiple Servers with Alibaba Cloud Server Load Balancer
Handling load balancing for a multiple-cloud setup can be a complex process. Mission-critical applications require a highly available solution to manage a heavy workload. Alibaba Cloud Server Load Balancer simplifies the distribution of workload across servers, network links, and other resources to minimize latency and prevent overload. With Server Load Balancer, you can balance multiple cloud servers or scale your application to optimize resource utilization.
This tutorial describes the process of setting up Server Load Balancer to distribute load across multiple cloud servers.
You would need to have multiple ECS instances running on your console. You would also need to configure the ECS instances to host web pages correctly.
Step 1: Purchasing a Server Load Balancer Instance
1.Log in to your Alibaba Cloud Console.
2.Under the Products and Services section, select Server Load Balancer.
3.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.
4.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.
5.Verify your selection on the next page and click Activate to activate the service.
Step 2: Configuring Server Load Balancer
You will need to configure the purchased Server Load Balancer instance before using it.
1.On the management console, select Server Load Balancer.
2.To change the name of your instance, place your cursor in the Server Load Balancer ID/Name column and click the Edit icon.
3.Click Manage to modify the configurations of your instance.
4.Select Listener in the left panel.
5.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.
6.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.
7.Click Expand Advance Options and set the parameters as shown in the figure below. Click Confirm to proceed.
8.Click Confirm to close the dialogue box and return to the management console.
9.In the left panel, navigate to Backend Server located under Server. Click the Servers Not Added tab to view all available servers.
10.Click Add to add ECS instances onto Server Load Balancer.
11.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.
12.You will now see the two backend ECS instances added and displayed in the Servers Added tab.
13.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!
Sign up to Alibaba Cloud today!
Get Paid by Sharing Your Technical ExpertiseBecome an Author