This topic describes how to migrate Dubbo applications from a self-managed ZooKeeper registry to a Microservices Engine (MSE) ZooKeeper registry.
Prerequisites
The MSE Sync tool is deployed. For more information, see Migration solution based on MSE Sync.
An MSE Zookeeper instance is created. For more information, see Create a ZooKeeper engine.
Limits
If the MSE Sync tool breaks down, the synchronization service is interrupted. Therefore, we recommend that you deploy the MSE Sync tool on at least two nodes. After the migration process starts, you must complete the migration at the earliest opportunity.
The networks among the self-managed ZooKeeper instance, MSE Sync, and MSE ZooKeeper instance are interconnected.
Specifications
Number of Dubbo services | Number of providers | Number of consumers | Minimum instance specifications | Minimum migration tool specifications |
0-1000 | 0-3000 | 0-9000 | 2 CPU cores and 4 GB of memory | 2 CPU cores and 4 GB of memory |
1000-4000 | 0-12000 | 0-36000 | 4 CPU cores and 8 GB of memory | 4 CPU cores and 8 GB of memory |
4000-7000 | 0-21000 | 0-63000 | 8 CPU cores and 16 GB of memory | 4 CPU cores and 8 GB of memory |
7000-10000 | 0-30000 | 0-90000 | 16 CPU cores and 32 GB of memory | 8 CPU cores and 16 GB of memory |
Minimum instance specifications: We recommend that you deploy at least three nodes in the production environment and deploy at least five nodes in critical environments.
Minimum migration tool specifications: If you want to implement high availability, we recommend that you deploy at least two nodes.
Procedure
Step 1: Create a migration task
In the left-side navigation pane of the MSE Sync tool, click Cluster Configuration. Then, click Add Cluster. In the Add Cluster dialog box, add the information about the source ZooKeeper instance, and click OK.
Parameter
Description
Cluster Name
Enter a name of the instance.
Cluster Type
Select ZK.
Cluster IP
Enter one or more combinations of an IP address and port number of the ZooKeeper instance. Each combination occupies one line. The default port number is 2181. Example:
127.0.0.1:2181 127.0.0.2:2181 127.0.0.3:2181
If the source instance uses a Server Load Balancer (SLB) instance for load balancing, enter the IP address and port number of the SLB instance.
Click Add Cluster again to add the information about the destination ZooKeeper instance.
Cluster Type: Select ZK.
Cluster IP Address List: Enter one or more combinations of an endpoint and service port number of the MSE ZooKeeper instance. Example: mse-8b7de****-p.zk.mse.aliyuncs.com:2181.
In the left-side navigation pane, click Service Synchronization. On the page that appears, click New Sync. In the New Sync dialog box, add the Dubbo applications that you need to migrate.
Sync Mode: Select Bidirection. In this mode, data can be synchronized between the source and destination instances if data on the source or destination instance updates.
Sync Type: Select Service Information. MSE Sync automatically displays all applications that are registered with the source instance. You can select the applications based on your business requirements.
Group Name: If you want to synchronize multiple applications, you can leave this parameter empty. Otherwise, you must enter a specific Dubbo group name.
Click OK.
The synchronized application names are displayed on the Service Synchronization page of the MSE Sync tool.
Step 2: Verify the synchronization result
Log on to the MSE console and select a region in the top navigation bar.
In the left-side navigation pane, choose .
On the Instances page, click the name of the instance.
In the left-side navigation pane, click . Check whether services exist in the default Dubbo path.
Step 3: Migrate the Dubbo client
Change the endpoint of the Dubbo client.
Find the XML configuration file of the Dubbo client and replace the endpoint of the self-managed ZooKeeper instance in
dubbo:registry address
with the endpoint of the MSE ZooKeeper instance. The following code provides an example.Before the change:
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
After the change:
<dubbo:registry address="zookeeper://mse-8b7de****-p.zk.mse.aliyuncs.com:2181"/>
Restart the Dubbo client to connect the client to the MSE ZooKeeper instance.
NoteTo ensure business continuity, we recommend that you restart Dubbo clients in batches. After the restart is complete, check whether all Dubbo clients are connected to the MSE ZooKeeper instance.
Step 4: Shut down the self-managed ZooKeeper instance
Shut down the self-managed ZooKeeper instance.
Disable the MSE Sync tool.