If your applications need to run on SAE instances and Elastic Compute Service (ECS) instances at the same time, you can use the hybrid deployment solution that is described in this topic. This topic describes how to add an ECS instance to the vServer group of an SAE application that is associated with a Serverless Load Balancer (SLB) instance.

Prerequisites

Description

You can declare the IDs, ports, and weights of existing ECS instances in an SAE application. In scenarios such as application deployment, stop, start, and restart, instance scaling, and specification scaling, SAE automatically maintains the backend server group of the associated SLB instance. You can add the ECS instances to the vServer group to which the SAE instances belong. Then, ECS and SAE provide services for external clients at the same time.

SAE does not interfere with the lifecycle of the ECS instances. SAE only provides instance connection APIs for graceful start and shutdown, and service integration. You must make sure that the SAE instances and ECS instances of your applications reside in the same VPC.

You need only to add the ECS instances to the backend server group that is maintained by SAE in the SLB console.

Important
After you enable hybrid deployment, you cannot modify the SLB instance or bind the SLB instance to another SAE application. Before you can modify the SLB instance or bind the SLB instance to another SAE application, you must remove the ECS instances from the SLB instance. If you change the listening ports of the SLB instance in the SAE console, you must reconfigure the ECS instances.

Procedure

  1. Log on to the CLB console.
  2. In the left-side navigation pane, choose CLB (FKA SLB) > Instances. In the top navigation bar, select a region.
    You must select the region where the SLB instance that is bound to the SAE application resides.
  3. On the Instances page, find the SLB instance that is bound to the SAE application, click the instance name, and then click the VServer Groups tab.
    Note
    vServer groups whose names start with asi are automatically created by SAE.
  4. Find the vServer group that you want to manage and click Edit in the Actions column.
  5. On the Edit VServer Group page, click Add More.
  6. In the Select Servers step of the Servers panel, select the ECS instance in the required VPC and click Next.
  7. In the Ports/Weights step, configure the port and traffic weight based on your business requirements, and then click Add.
    Note
    • An ECS instance of a greater weight receives more requests. The weight for each SAE instance is 100 and cannot be changed.
    • If session persistence is enabled, requests may not be evenly distributed to backend servers.
    • If you set the weight of an ECS instance to 0, the ECS instance no longer receives new requests.
    On the Edit VServer Group page, you can view the information about the ECS instance.
  8. Click Save.
  9. In the Confirm message, click OK.