All Products
Search
Document Center

Serverless App Engine:Use a self-managed Nacos service registry

Last Updated:Aug 22, 2025

When you deploy a locally developed Spring Cloud or Dubbo application to SAE, you can use the SAE service registry or a self-managed Nacos instance for service registration and discovery. This topic describes how to configure Nacos service registration and discovery for an application in the SAE console.

Prerequisites

  • The yum command is installed.

  • Before you run the application, ensure that the access port for the Nacos registry, such as 8848, is added to a security group. For specific instructions, see Add a security group rule.

Recommendations

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

Step 1: Configure Nacos

Nacos requires a Java environment to run. If you are building Nacos from source code, Maven is also needed. After installation, Nacos provides service registration and discovery, so be sure to specify the service registry in your application. Services will then be registered and discovered automatically.

For specific instructions, see Nacos Quick Start.

Step 2: Configure the service registration and discovery feature in the SAE console

This section describes only the key steps.

  1. The entry points for operations vary depending on the scenario:

    When creating an application

    1. Log on to the SAE console. In the navigation pane on the left, click Applications > Applications. Then, select a region and namespace, and click Create Application.

    2. On the Basic Information page, configure the required parameters and click Next: Advanced Settings.

    When modifying a running 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.

    1. Log on to the SAE console. In the navigation pane on the left, click Application > Applications. Then, select a region and namespace, and click the name of the application.

    2. On the Basic Information page of the application, click Deploy Application.

    When modifying a stopped application

    1. Log on to the SAE console. In the navigation pane on the left, click Applications > Applications. Then, select a region and namespace, and click the name of the application.

    2. On the Basic Information page of the application, click Modify Application Configurations.

  2. Select one of the following methods to connect to Nacos.

    Method 1: Configure service registration and discovery

    In the Service Registration and Discovery section, set Nacos-based Registry Service and Discovery to Self-managed Registry (Such as Nacos and ZooKeeper).

    SAE provides a Nacos Server that supports automatic addressing for Java microservices. You can configure this using the Service Registration And Discovery feature in SAE

    MyXwWOG88K

    Method 2: Configure startup parameters

    When configuring startup parameters, ensure the following:

    • Ensure that the SAE network is connected to the network of your self-managed Nacos instance.

    • Ensure that the -D and -XX parameters are not used together. Otherwise, the command may be invalid. The following code provides an example:

      • Before modification:

        java -Dalicloud.deployment.mode=EDAS_MANAGED -XX:+UseContainerSupport -XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UnlockExperimentalVMOptions -XX:+UseWisp2 -Dio.netty.transport.noNative=true -XX:+UseG1GC -Dspring.profiles.active=yace -Dnacos.use.endpoint.parsing.rule=false -Dnacos.use.cloud.namespace.parsing=false -jar /home/admin/app/xx-server.jar
      • After modification:

        java -XX:+UseContainerSupport -XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -XX:+UnlockExperimentalVMOptions -XX:+UseWisp2 -Dio.netty.transport.noNative=true -XX:+UseG1GC -Dspring.profiles.active=yace -Dnacos.use.endpoint.parsing.rule=false -Dnacos.use.cloud.namespace.parsing=false -jar /home/admin/app/xx-server.jar
    • We recommend that you deploy the application using an image or a JAR package and configure the -Dnacos.use.endpoint.parsing.rule=false and -Dnacos.use.cloud.namespace.parsing=false startup parameters.

      Important

      The startup parameters must be placed before -jar. Otherwise, you may be unable to use a service registry that is not provided by SAE.

      • If you use an image, you must configure the -Dnacos.use.endpoint.parsing.rule=false and -Dnacos.use.cloud.namespace.parsing=false parameters in the image file's startup command. See Create an image for more.

        The following command provides an example:

        RUN echo 'eval exec java -Dnacos.use.endpoint.parsing.rule=false -Dnacos.use.cloud.namespace.parsing=false -jar $CATALINA_OPTS /home/admin/app/hello-edas-0.0.1-SNAPSHOT.jar'> /home/admin/start.sh && chmod +x /home/admin/start.sh
      • If you use a JAR package, enter -Dnacos.use.endpoint.parsing.rule=false -Dnacos.use.cloud.namespace.parsing=false in the Options Settings text box under Startup Command Settings in the console. The following figure shows a Java application that runs in an Open JDK 8 environment. For more information, see Set a startup command.

        bl4aSvSA79