All Products
Search
Document Center

Serverless App Engine:Use the SAE built-in Nacos registry

Last Updated:Nov 20, 2023

Serverless App Engine (SAE) allows you to use the following types of Nacos registries in the SAE console: self-managed Nacos registry, SAE built-in Nacos registry, and Microservices Engine (MSE) Nacos registry. This topic describes how to configure the Nacos registry-based service registration and discovery feature for an application in the SAE console.

Prerequisites

Prerequisites vary based on the types of Nacos registries. For more information, see the following topics:

  • If you use an MSE Nacos registry, follow the instructions that are provided in Use an MSE Nacos registry.

  • If you use a self-managed Nacos registry, follow the instructions that are provided in Use a self-managed Nacos service registry.

  • If you use the SAE built-in Nacos registry, follow the instructions that are provided in this topic. SAE automatically modifies the registry address and the configuration center address of the program that you want to deploy by injecting related environment variables and using a Java agent to modify bytecode. You can deploy a program on SAE without the need to modify the program.

Background information

If you have a large number of microservices applications, you can use one of the following types of service registries that are listed in descending order by recommendation level:
  • MSE Nacos registry
  • Self-managed service registry
  • SAE built-in service registry

For more information, see MSE Nacos and Open source Nacos.

Limits

  • The SAE built-in Nacos registry does not support Seata.

  • The following nacos-client versions are available:

    • [2.0.0, 2.1.0)

    • [2.1.2, 2.2.0)

    • [2.2.2, latest)

Configure service registration and discovery when you create an application

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click Create Application.

  3. In the Basic Information step, configure the parameters and click Next: Application Deployment Configurations.

  4. In the Deployment Configurations step, configure the Technology Stack Programming Language and Application Deployment Method parameters and the corresponding settings.

    1. In the Service Registration and Discovery section, click the Nacos Registry-based Service Discovery tab and select SAE Built-in Nacos.

    2. Click Next: Confirm Specifications.

  5. In the Specification Confirmation step, view the details of the application and the fee for the selected specifications. Then, click Confirm.

    The Creation Completed step appears. You can click Application Details to go to the Basic Information page of the application.

  6. Use one of the following methods to check whether the configuration has taken effect:

    • Method 1:

      In the left-side navigation pane of the Basic Information page, click Change Records. On the Change Records page, view the change details. If Executed is displayed in the Change Status column, the application is deployed and the configurations have taken effect.

    • Method 2:

      On the Basic Information page, click the Instance Deployment Information tab to view the Status of the instances. If Running is displayed in the Status column, the application is deployed and the configurations have taken effect.

Configure service registration and discovery when you deploy an application

Warning

After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.

The procedure that can be performed to update an application varies based on the number of instances in the application. This section provides an example on how to configure the required features for an application in which the number of instances is greater than or equal to 1. For information about how to update an application in which the number of instances is 0, see Update an application.

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.

  3. In the upper-right corner of the Basic Information page, click Deploy Application.

  4. In the Service Registration and Discovery section of the Deploy Application page, click the Nacos Registry-based Service Discovery tab and select SAE Built-in Nacos.

  5. After you configure the settings, click Confirm.

  6. Use one of the following methods to check whether the configuration has taken effect:

    • Method 1:

      In the left-side navigation pane of the Basic Information page, click Change Records. On the Change Records page, view the change details. If Executed is displayed in the Change Status column, the application is deployed and the configurations have taken effect.

    • Method 2:

      On the Basic Information page, click the Instance Deployment Information tab to view the Status of the instances. If Running is displayed in the Status column, the application is deployed and the configurations have taken effect.

References

If an application fails to be deployed, see the following topics to identify the failure cause: