Symptoms

When an application is developed, the on-premises Nacos is used for configuration. However, after the application is deployed to Enterprise Distributed Application Service (EDAS), the Nacos configuration becomes invalid.

Causes

EDAS provides the GA version of Nacos. After Nacos-based applications are deployed to EDAS, EDAS automatically replaces the Nacos Server address with that of Nacos in GA version provided by EDAS. If you have additional requirements, you can also use the self-managed Nacos. The on-premises Nacos and self-managed Nacos are configured by using different methods. If an invalid method is used, the Nacos configurations fail to take effect in EDAS. The following lists potential reasons for the failure.

  • When you use the configuration center of EDAS, you have not synchronized your configurations from the self-managed Nacos to the configuration center.
  • When you use the self-managed Nacos, you have not set required parameters in the application. As a result, the IP address of the Nacos server is replaced by the IP address of the configuration center.
Notice If the version of Nacos client is earlier than 1.0.1, exceptions may occur.

Solutions

  1. You must make sure that the version of the Nacos Client in use is 1.0.1 and later.
  2. You must check whether to use the configuration center of EDAS to manage the application configurations.
    • If yes, create and synchronize the configurations of the self-managed Nacos that is used by the application in the related namespace. For more information, see Create a configuration item.
    • If no, use the self-managed Nacos. Perform Step 2.
  3. Add the following two parameters to the application configuration. For more information, see Set JVM parameters, and then restart the application.

    In case the self-managed Nacos is replaced when you deploy an application to EDAS, you can also set the following parameters when you develop the application:

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