All Products
Search
Document Center

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

Last Updated:Apr 01, 2026

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

Choose a registry

If you manage a large number of microservices, choose a registry in the following order (highest to lowest recommendation):

  1. MSE Nacos registry

  2. Self-managed service registry

  3. SAE built-in service registry

Prerequisites

Before you begin, make sure that you have:

  • The yum command available on your system

  • The access port for the Nacos registry (such as 8848) added to a security group. To add security group rules, see Add a security group rule.

Step 1: Set up Nacos

Nacos requires a Java runtime environment. If you are building from source, Maven is also required. After Nacos is running, configure your application to point to the Nacos address as its service registry. Nacos then handles service registration and discovery automatically.

For installation instructions, see Nacos Quick Start.

Step 2: Connect your SAE application to Nacos

SAE supports two methods for connecting to a self-managed Nacos instance. Use Method 1 for most scenarios. Use Method 2 if you need to configure JVM startup parameters directly.

Open the application settings

The entry point depends on the state of your application:

Creating a new application

  1. Log on to the SAE console. In the left navigation pane, click Applications > Applications.

  2. Select a region and namespace, then click Create Application.

  3. Complete the Basic Information page and click Next: Advanced Settings.

Modifying a running application

Warning

Redeploying an application restarts it. To minimize disruption, deploy during off-peak hours.

  1. Log on to the SAE console. In the left navigation pane, click Application > Applications.

  2. Select a region and namespace, then click the application name.

  3. On the Basic Information page, click Deploy Application.

Modifying a stopped application

  1. Log on to the SAE console. In the left navigation pane, click Applications > Applications.

  2. Select a region and namespace, then click the application name.

  3. On the Basic Information page, click Modify Application Configurations.

Method 1: Configure service registration and discovery (recommended)

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 built-in Nacos server that supports automatic addressing for Java microservices. You can configure it using the Service Registration And Discovery feature in SAE.
MyXwWOG88K

Method 2: Configure startup parameters

Use this method when you need to set Nacos-related JVM parameters directly in the application startup command.

Before you configure startup parameters:

  • Confirm that the SAE network can reach the network where your self-managed Nacos instance runs.

  • Do not mix -D and -XX parameters in the same command — this can cause parameters to be ignored. Remove any -Dalicloud.deployment.mode=EDAS_MANAGED parameter if present. Before:

    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:

    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 following startup parameters:

-Dnacos.use.endpoint.parsing.rule=false -Dnacos.use.cloud.namespace.parsing=false
Important

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

For image-based deployment

Add the parameters to the startup command in your Dockerfile:

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

For instructions on creating a compatible image, see Create an image.

For JAR package deployment

In the SAE console, under Startup Command Settings, enter the two parameters in the Options Settings field. The following screenshot shows an example for an application running on Open JDK 8.

bl4aSvSA79

For more information, see Set a startup command.