Switching all production traffic from an existing gateway to a new one in a single cutover risks downtime if configuration issues surface under load. CLB-based migration eliminates this risk by using weighted round-robin (WRR) scheduling on a Classic Load Balancer (CLB) instance to gradually shift traffic from your source gateway to a Microservices Engine (MSE) cloud-native gateway. You start with a small percentage, verify that the new gateway handles requests correctly, and increase the percentage until the migration is complete.
Prerequisites
Before you begin, make sure that you have:
-
An MSE cloud-native gateway of version 1.2.3 or later. For more information, see Create a cloud-native gateway
-
Routing rules configured on the MSE cloud-native gateway that cover all routing scenarios of the source gateway. For more information, see Create a routing rule
CLB-based migration supports only CLB instances. Application Load Balancer (ALB) and Network Load Balancer (NLB) instances are not supported. For more information, see SLB overview.
How it works
A CLB instance sits in front of both gateways and distributes traffic based on the weight you assign to each one. The following table summarizes the traffic flow at each stage:
| Stage | Traffic flow | Weight setting |
|---|---|---|
| Before migration | Client → DNS → CLB (Layer 4) → source gateway (Layer 7) → backend server | Source gateway: 100% |
| During migration | CLB distributes traffic between both gateways based on weight | Example: source gateway 90%, MSE gateway 10% |
| After migration | Client → DNS → CLB (Layer 4) → MSE cloud-native gateway → backend server | MSE gateway: 100% |
During migration, MSE cloud-native gateway nodes are added to the CLB vServer group. Adjust the weight to control the traffic ratio.
Step 1: Add a CLB-based migration task
-
Log on to the MSE console.
-
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.
-
On the Gateways page, click the ID of the gateway.
-
On the Overview page, click the Endpoint tab. On the Gateway Ingress page, click Migrate CLB in the upper-right corner.
-
In the Migrate CLB panel, configure the following parameters and click OK.
Parameter
Description
Network Type
The network type of the CLB instance. Select Internet or VPC based on the IP address of the CLB instance.
CLB Instance
The CLB instance to use for migration.
Listener Ports and Backend Servers
Click Add and specify Listener Port and Gateway Protocol for the CLB instance. The corresponding vServer groups are then displayed. You can select one or both of the HTTP and HTTPS vServer groups.
Weight
The total weight assigned to the MSE cloud-native gateway in the vServer group. Set the initial weight to 0 and increase it after you change the CLB scheduling algorithm to weighted round-robin in step 8. Otherwise, the weight configuration does not take effect. A value of 0 means no traffic is routed to the MSE gateway. A value of 100 means all traffic is routed to the MSE gateway. When you set the weight to 100, manually set the weight of the source gateway nodes to 0 in the vServer group.
How weight distribution works across gateway nodes
The total weight is divided equally among gateway nodes. For example, if a gateway has 2 nodes and a total weight of 20, each node receives a weight of 10. Make sure that the total weight of all nodes in the vServer group adds up to 100. Otherwise, a conflict occurs.
The following table shows a sample weight distribution:
Component Nodes Weight per node Total weight Source gateway 2 40 80 MSE cloud-native gateway 2 10 20 vServer group total 100 NoteThe weight parameter applies only to new MSE gateway nodes added to the vServer group. Existing gateway nodes in the vServer group are not affected.
-
On the Gateway Ingress tab, find the CLB instance and click Monitor in the Actions column to go to the Instances page in the SLB console.
-
On the Instances page, click the Listener tab. Find the target listener and click Modify Listener in the Actions column.
-
On the Configure Listener page, click Modify next to Advanced Settings. Set Scheduling Algorithm to Weighted Round-Robin (WRR) and click Next. Configure the backend server and health check based on your requirements.
-
Click Submit.
The scheduling algorithm is now set to weighted round-robin. To verify, click the listener and check that Scheduling Algorithm shows Weighted Round-Robin in the Listener Details panel.
Step 2: Adjust the traffic ratio
After the CLB scheduling algorithm is set to weighted round-robin, increase the weight gradually to shift traffic to the MSE cloud-native gateway.
-
Log on to the MSE console.
-
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.
-
On the Gateways page, click the ID of the gateway.
-
On the Gateway Ingress tab, click Migrate CLB. In the Migrate CLB panel, update the Weight value.
Start with a small weight, such as 10%, and monitor for errors. If traffic flows correctly, increase the weight incrementally until it reaches 100%.
Migration stage MSE gateway weight Source gateway weight Action Initial verification 10 90 Monitor for errors Partial migration 50 50 Validate under load Full migration 100 0 Confirm all traffic is on the MSE gateway -
In the left-side navigation pane, choose Observation Analysis > Business Monitoring. On the Global Dashboard tab, review the traffic distribution to confirm the expected ratio.
Roll back the migration
If you encounter issues at any stage, roll back all traffic to the source gateway:
-
On the Gateway Ingress tab, click Migrate CLB. In the Migrate CLB panel, set Weight to 0.
-
In the left-side navigation pane, choose Observation Analysis > Business Monitoring. On the Global Dashboard tab, confirm that no traffic is reaching the MSE cloud-native gateway.
(Optional) Step 3: Disassociate the CLB instance
After the migration is complete and all traffic is routed through the MSE cloud-native gateway, disassociate the CLB instance to clean up the migration configuration.
-
Log on to the MSE console.
-
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.
-
On the Gateways page, click the ID of the gateway.
-
On the Gateway Ingress tab, find the CLB instance and click Unbind Server Load Balancer in the Actions column. In the confirmation message, click OK.
NoteAfter you disassociate the CLB instance, traffic on that CLB instance is no longer routed to the cloud-native gateway. To keep the migration configuration but stop routing traffic, set Weight to 0 in the Edit CLB Migration panel instead.