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
- An SLB instance is bound to an SAE application. For more information, see Bind an SLB instance to an application.
- An ECS instance is created and an application is deployed. For more information, see Create an ECS instance.
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.
Procedure
- Log on to the CLB console.
- In the left-side navigation pane, choose . 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.
- 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. vServer groups whose names start with
asi
are automatically created by SAE. - Find the vServer group that you want to manage and click Edit in the Actions column.
- On the Edit VServer Group page, click Add More.
- In the Select Servers step of the Servers panel, select the ECS instance in the required VPC and click Next.
- In the Ports/Weights step, configure the port and traffic weight based on your business requirements, and then click Add.
- 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. - Click Save.
- In the Confirm message, click OK.