All Products
Search
Document Center

Microservices Engine:CLB-based migration

Last Updated:Apr 09, 2024

Microservices Engine (MSE) cloud-native gateways provide the Classic Load Balancer (CLB)-based migration feature for you to gradually migrate traffic from a source gateway to an MSE cloud-native gateway. This topic describes how to use the CLB-based migration feature.

Prerequisites

  • An MSE cloud-native gateway of 1.2.3 or later is created. For more information, see Create a cloud-native gateway.

  • Routing rules are configured for the MSE cloud-native gateway, and the routing rules cover all routing scenarios of the source gateway. For more information, see Create a routing rule.

Note

The Server Load Balancer (SLB)-based migration feature is applicable only to CLB instances. Application Load Balancer (ALB) instances and Network Load Balancer (NLB) instances are not supported. For more information about the three types of SLB instances, see SLB overview.

Background information

  • Before the migration: A typical user request process is used. The client accesses the server by using the Domain Name System (DNS). The DNS returns the IP address of the Layer-4 SLB instance that is associated with the gateway to the client. The client sends a request to the SLB instance, and the SLB instance passes through the request to the Layer-7 business gateway. The business gateway performs operations such as authentication and then forwards the request to the server.

  • During the migration: The nodes of the MSE cloud-native gateway are added to the specified vServer group of the SLB instance, and a total weight is configured for the cloud-native gateway. For example, a total weight of 10% is configured for the cloud-native gateway. The weighted round-robin algorithm is configured as the SLB scheduling algorithm. In this case, the SLB instance distributes traffic from the client based on the weight value. 10% of the traffic is routed to the MSE cloud-native gateway. You can adjust the total weight of the cloud-native gateway to control the percentage of traffic that you want to migrate.

    Note

    The weighted round-robin algorithm enables the gateway to distribute requests to upstream servers based on their weights. Backend servers that have higher weights receive more requests than those that have lower weights.

  • After the migration: The total weight of the MSE cloud-native gateway is set to 100%, and all traffic on the SLB instance is forwarded to the MSE cloud-native gateway. The migration is complete.

Step 1: Add a CLB-based migration task

  1. Log on to the MSE console.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.

  3. On the Gateways page, click the name of the gateway.

  4. On the Overview page, click the Gateway Ingress tab. Then, click Migrate CLB in the upper-right corner.

  5. In the Migrate CLB panel, configure the parameters and click OK.

    Parameter

    Description

    Network Type

    Select a network type based on the IP address of the CLB instance that is used for migration. Valid values: Internet and VPC.

    CLB Instance

    The CLB instance that is used for migration.

    Listener Ports and Backend Servers

    Click Add and specify Listener Port and Gateway Protocol for the CLB instance. Then, the vServer groups are displayed.vServer group

    Note

    You can select one or both of the HTTP and HTTPS vServer groups.

    Weight

    The total weight of the cloud-native gateway in the vServer group of the CLB instance that is used for migration. We recommend that you set the initial weight to 0 and increase the weight after the CLB configuration is complete.

    • The value 0 indicates that no traffic is routed to the cloud-native gateway. We recommend that you set the initial weight to 0 and increase the weight after the CLB scheduling algorithm is changed.

    • The value 100 indicates that all traffic is routed to the cloud-native gateway. If you set the weight to 100, you must manually set the weight of the source gateway nodes in the vServer group to 0. This ensures that all traffic is routed to the cloud-native gateway.

    For example, a gateway has two nodes, and the total weight of the gateway is 20. After the gateway is added to the vServer group of the CLB instance that is used for migration, the weight of each node in the gateway is 10. You must manually adjust the weights of nodes in the vServer group to ensure that the total weight is 100. Otherwise, a conflict occurs.

    Note
    • After you configure the weight, change the CLB scheduling algorithm to weighted round-robin. Otherwise, the weight configuration does not take effect.

    • This parameter is valid only for new gateway nodes. Existing gateway nodes in the vServer group are not affected by this parameter.

  6. On the Gateway Ingress tab, find the CLB instance that is used for migration and click Monitor in the Actions column to go to the Instances page in the SLB console.

  7. On the Instances page, click the Listener tab. Find the desired listener and click Modify Listener in the Actions column.

  8. On the Configure Listener page, click Modify next to Advanced Settings. Set Scheduling Algorithm to Weighted Round-Robin (WRR), and click Next. You can configure the backend server and health check based on your business requirements.

  9. Click Submit. The scheduling algorithm of the CLB instance that is used for migration is changed to weighted round-robin.

    Click the desired listener. In the Listener Details panel, you can find that Scheduling Algorithm is changed to Weighted Round-Robin.

Step 2: Adjust the percentage of traffic to be migrated

Modify the weight in the CLB-based migration to adjust the percentage of traffic to be migrated.

  1. Log on to the MSE console.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.

  3. On the Gateways page, click the name of the gateway.

  4. On the Gateway Ingress tab, click Migrate CLB. In the Migrate CLB panel, configure the Weight parameter.

    We recommend that you set the weight to a small value for verification and then gradually increase the weight to 100. Upon any exceptions, you can set the weight to 0 to terminate the migration.

  5. In the left-side navigation pane, choose Observation Analysis > Business Monitoring. On the Global Dashboard tab, view the traffic distribution.

(Optional) Step 3: Disassociate the CLB instance

  1. Log on to the MSE console.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.

  3. On the Gateways page, click the name of the gateway.

  4. On the Gateway Ingress tab, find the desired CLB instance and click Unbind Server Load Balancer in the Actions column. In the message that appears, click OK.

    Note
    • After you disassociate the CLB instance from the cloud-native gateway, traffic on the CLB instance is not routed to the cloud-native gateway.

    • If you want to retain the CLB-based migration configuration and do not want to route traffic to the cloud-native gateway, you can set Weight to 0 in the Edit CLB Migration panel.