Application Configuration Management (ACM) is being decommissioned, and all its data will be deleted. Migrate your configurations to Microservices Engine (MSE) Nacos as soon as possible to take advantage of its enhanced performance, stability, and richer feature set. You can export configurations from the ACM console and import them into the MSE console.
After ACM reaches its end of support, you can no longer create or edit configurations in the ACM console. API calls will not be covered by a Service Level Agreement (SLA). We strongly recommend that you complete the migration as soon as possible.
Step 1: Export configurations to MSE Nacos
-
Log on to the MSE buy page with your Alibaba Cloud account and purchase an MSE Nacos Professional Edition instance. The Professional Edition supports configuration authentication, encryption, and offers enhanced high availability. For guidance on selecting the number of vCPUs, memory size, and number of nodes, see Estimate the capabilities of Microservices Registry instances. To estimate the required public bandwidth, use the following formula: Change frequency (requests/s) × Number of configurations × Configuration size (KB).
-
Export the configurations that you want to migrate from the ACM console.
-
Log on to the ACM console.
-
On the Configurations page, select the target configuration, click Export below the list, and then click Export in the Export Configurations (public) dialog box.
-
Save the exported configuration file.
-
-
Import the configurations into the MSE console.
-
Log on to the MSE console.
-
In the left-side navigation pane, choose Microservices Registry > Instances.
-
On the Instances page, click the Instance ID of the Nacos instance that you purchased.
-
In the left-side navigation pane, choose Configuration Management > Configurations.
-
On the Configurations page, click Import Configuration.
-
In the Import Configuration dialog box, select a policy for handling a Same Configurations, click Upload File to upload the configuration file exported from the ACM console, and then click OK.
-
Step 2: Replace application business parameters
Follow the steps that match your application type to replace the business parameters.
Migrate Spring Cloud Alibaba applications
If your application is a Spring Cloud Alibaba application, modify the bootstrap.properties configuration file.
Replace the following content:
spring.cloud.nacos.config.endpoint=${ACM_PUBLIC/INTERNAL_ENDPOINT}
with:
spring.cloud.nacos.config.server-addr=${MSE_NACOS_PUBLIC/INTERNAL_ENDPOINT}
Also, update the namespace to your MSE Nacos namespace:
spring.cloud.nacos.config.namespace=${MSE_NACOS_NAMESPACE_ID}
For a runnable demo, see acm2nacos-spring-cloud-example.
To verify whether your application is a Spring Cloud Alibaba application:
Check the pom.xml file for the following dependency:
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
-
This migration method is supported only by MSE Nacos 2.0.3 and later. If your MSE Nacos version is earlier than 2.0.3, upgrade your instance in the MSE console. The upgrade takes about 5 to 6 minutes. Upgrade the Nacos engine version
-
To ensure high availability for your cluster, configure at least three nodes.
-
You can find the public and internal endpoints of your MSE Nacos instance on its Basic Information page.
-
The default namespace in MSE Nacos has no ID, so you can leave the parameter empty. If you use a non-default namespace, you can find its ID on the Namespaces page of your instance.
If you use a public endpoint for deployment, you must add the client IP addresses to the whitelist to ensure connectivity. Set a whitelist
An empty whitelist allows access from any IP address.
Migrate Java applications
-
If you use the ACM-Java-SDK, your
pom.xmlfile contains the following dependency:<dependency> <groupId>com.alibaba.edas.acm</groupId> <artifactId>acm-sdk</artifactId> </dependency>To migrate, add the following JVM argument and redeploy the application.
-DDIAMOND.SERVER.IPS=${MSE_NACOS_PUBLIC/INTERNAL_ENDPOINT}Also, modify the namespace setting in your code.
properties.put("namespace", "${namespaceId}"); -
If you use an ACM client and want to switch to a Nacos client, follow the instructions for migrating Nacos-Java-SDK users.
-
If you use the Nacos-Java-SDK, your
pom.xmlfile contains the following dependency:
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</dependency>
Replace the ${...} placeholder with the MSE public or internal endpoint and ${namespaceId} with the MSE namespace ID, then redeploy the application. If you use the default namespace, leave the namespace parameter empty.
properties.put("serverAddr", ${MSE_NACOS_PUBLIC/INTERNAL_ENDPOINT});
properties.put("namespace", "${namespaceId}");
Add the following argument at startup to complete the migration.
-Dnacos.cache.data.init.snapshot=false
For an official Java demo, see acm2nacos-java-example. For an official Java application demo, see Java SDK.
Migrate nacos-spring-boot applications
If your application is a nacos-spring-boot application, modify the application.properties configuration file.
Replace the following content:
nacos.config.endpoint=${ACM_PUBLIC/INTERNAL_ENDPOINT}
with:
nacos.config.server-addr=${MSE_NACOS_PUBLIC/INTERNAL_ENDPOINT}
Also, update the namespace to your MSE Nacos namespace:
nacos.config.namespace=${MSE_NACOS_NAMESPACE_ID}
Migrate Golang applications
Before calling the API, configure environment variables for your access credentials. Use MSE_AK as the AccessKey ID and MSE_SK as the AccessKey Secret.
-
If you use the ACM-golang-SDK, replace
${endpoint}with the public/internal endpoint of your MSE Nacos instance.clientConfig := constant.ClientConfig{ Endpoint: ${endpoint} + ":8080", NamespaceId: namespaceId, AccessKey: MSE_AK, SecretKey: MSE_SK, TimeoutMs: 5 * 1000, ListenInterval: 30 * 1000, } -
If you use the Nacos-golang-SDK, replace
${serverAddr}with the public/internal endpoint of your MSE Nacos instance.sc := []constant.ServerConfig{ { IpAddr: "${serverAddr}", Port: 8848, }, }
For an official Golang application demo, see nacos-sdk-go.
Migrate Python applications
-
If you use the ACM-Python-SDK, replace
${endpoint}with the public/internal endpoint of your MSE Nacos instance and${namespace_id}with its namespace ID.ENDPOINT = "${endpoint}" NAMESPACE = "${namespace_id}" c = acm.ACMClient(ENDPOINT, NAMESPACE, AK, SK) -
If you use the Nacos-Python-SDK, replace
${server_address}with the public/internal endpoint of your MSE Nacos instance and${namespace_id}with its namespace ID.SERVER_ADDRESSES = "${server_address}" NAMESPACE = "${namespace_id}" client = nacos.NacosClient(SERVER_ADDRESSES, namespace=NAMESPACE)
Migrate Node.js applications
-
If you use the ACM-Nodejs-SDK, replace
${endpoint}with the public/internal endpoint of your MSE Nacos instance and${namespace_id}with its namespace ID.// for find address mode const configClient = new NacosConfigClient({ endpoint: '${endpoint}', namespace: '${namespace_id}', accessKey: 'MSE_AK', secretKey: 'MSE_SK', requestTimeout: 6000, }); -
If you use the Nacos-Nodejs-SDK, replace
${server_address}with the public/internal endpoint of your MSE Nacos instance and${namespace_id}with its namespace ID.const configClient = new NacosConfigClient({ serverAddr: '${server_address}', namespace: '${namespace_id}', accessKey: 'MSE_AK', secretKey: 'MSE_SK', requestTimeout: 6000, });
Migrate C# applications
Replace ${server_address} with the public/internal endpoint of your MSE Nacos instance and ${namespace_id} with its namespace ID.
{
"NacosConfig": {
"Listeners": [
{
"Optional": false,
"DataId": "common",
"Group": "DEFAULT_GROUP"
},
{
"Optional": false,
"DataId": "demo",
"Group": "DEFAULT_GROUP"
}
],
"Namespace": "namespace_id", // Please set the value of Namespace ID.
"ServerAddresses": [ "http://${server_address}:8848/" ],
"UserName": "test2",
"Password": "123456",
"AccessKey": "MSE_AK",
"SecretKey": "MSE_SK",
"EndPoint": "acm.aliyun.com",
"ConfigFilterAssemblies": ["YouPrefix.AssemblyName"],
"ConfigFilterExtInfo": "some ext information"
}
}
Migrate C++ applications
-
If you use the ACM-CPP-SDK, replace
${endpoint}with the public/internal endpoint of your MSE Nacos instance and${namespace_id}with its namespace ID.// Initializes the configuration service using the following parameters. ACM::init("${endpoint}","$namespace_id","$accessKey","$secretKey"); -
If you use the Nacos-CPP-SDK, replace
${server_address}with the public/internal endpoint of your MSE Nacos instance.Properties props; props[PropertyKeyConst::SERVER_ADDR] = "${server_address}:8848";//Server address
(Optional) Step 3: Reauthorize the RAM user
If you use configuration authentication and have granted permissions to a RAM user, update the authorization script and re-grant permissions after migrating to MSE. Authorize access to Microservices Registry
-
Log on to the Resource Access Management (RAM) console.
-
In the left-side navigation pane, choose Permissions > Policies.
-
In the upper-left corner of the Policies page, click Create Policy.
-
On the Create Policy page, click the JSON tab.
-
Paste your local script into the policy editor, replacing the existing content.
The following is a sample script:
{ "Version": "1", "Statement": [ { "Action": [ "acms:R" ], "Resource": "*:*:*:*:cfg/1ca01ca0-11b0-1e01-0df1-d1010101bc10/DEFAULT_GROUP/com.alibaba.acm.test", "Effect": "Allow" } ] }
-
Replace read permissions
If the script contains the following content:
"Action": [ "acms:R" ]Replace it with:
"Action": [ "mse:List*", "mse:Query*", "mse:Get*" ] -
Replace write permissions
If the script contains the following content:
"Action": [ "acms:W" ]Replace it with:
"Action": [ "mse:Create*", "mse:Update*", "mse:Delete*" ] -
Replace the resource
Replace the following resource definition:
"Resource": "*:*:*:*:cfg/{acm_namespace_id}/{group_id}/{data_id}"with:
"Resource": "acs:mse:*:*:instance/{instance_id}/{mse_namespace_id}/{group_id}/{data_id}"NoteParameter descriptions:
-
{acm_namespace_id}: The namespace ID in ACM. -
{instance_id}: The ID of your MSE instance. -
{mse_namespace_id}: The namespace ID in MSE. -
{group_id}: The group ID. -
{data_id}: The data ID.
-
If you do not need to grant permissions at the group_id or data_id level, remove those parts from the resource path.
-
To grant permissions at the
namespacelevel, use the following resource path:"Resource": "acs:mse:*:*:instance/{instance_id}/{mse_namespace_id}" -
To grant permissions at the
group_idlevel, use the following resource path:"Resource": "acs:mse:*:*:instance/{instance_id}/{mse_namespace_id}/{group_id}"
After replacing the script, grant the permissions defined in the new policy to the RAM user. Authorize access to Microservices Registry
The new permissions for the RAM user take effect in about 5 to 10 seconds.
Step 4: Redeploy and start the application
Redeploy your application. The migration is complete when the deployment succeeds.