Microservices Engine (MSE) provides managed Nacos instances. The managed Nacos instances provide more powerful and stable features than open source Nacos instances. You do not need to maintain Nacos instances in MSE. This allows you to focus on your business. You can also obtain expert support if you use MSE Nacos Professional Edition. This topic describes how to smoothly migrate Spring Cloud applications from an Enterprise Distributed Application Service (EDAS) registry to an MSE Nacos instance.
Prerequisites
A Nacos instance is created. For more information, see Create a Nacos instance.
If your instance needs to be accessed only by applications in a VPC, you need only to create a VPC.
If your instance needs to be accessed by applications in different VPCs, you need to enable Internet access. A public IP address whitelist is required for Internet access. If a public IP address whitelist is left empty, all public IP addresses can be used to access your instance over the Internet. For more information, see Configure a public IP address whitelist.
For Spring Cloud applications, the solution supports dual subscription for consumers that use the Ribbon load balancing component. Dual subscription is not supported for consumers that use the Spring Cloud LoadBalancer component.
Background information
In this topic, a set of applications deployed on Alibaba Cloud EDAS is used to describe how to migrate applications. If you understand the scenarios of application migration from an EDAS registry, you can implement the solution that is described in Migration solutions.
Deploy the consumer and provider applications in the EDAS console. For more information about how to deploy applications, see Use images to deploy microservice-oriented applications in Kubernetes clusters.
Migration solutions
Log on to the ACK console.
- In the left-side navigation pane of the ACK console, click Clusters. On the Clusters page, find the cluster in which your application is deployed and click the cluster name.
- In the left-side navigation pane of the Cluster Information page, choose . On the Deployments page, select a namespace from the Namespace drop-down list.
- Find the application that you want to manage and click Edit in the Actions column.
- In the Environment Variable section of the Edit page, click Add, add the environment variables that are described in the following table, and then click Update.
The following table describes the added environment variables.
Type Variable Key Value/ValueFrom Custom environment variable enable_multi_nacos true Custom environment variable additional_nacos_address mse-9xxxxx-p.nacos-ans.mse.aliyuncs.com:8848 Note This variable value is the endpoint of the MSE Nacos instance.Custom environment variable additional_nacos_namespace e5bdc7e1-xxxx-4e2b-906d-b47b8efeee8b Note Optional. If this variable is not configured, the default namespace of the MSE Nacos instance is used.
Verify the result
Verify the service registration result.
Log on to the MSE console and view the information about the instance with which the services are registered.
Service call result
In this example, the service consumer application is used to call the service provider application. You can enter the public endpoint of the consumer-slb service in the browser to view the service call result.