This guide explains how to migrate from a self-managed ZooKeeper registry for Dubbo to an MSE ZooKeeper registry.
Prerequisites
-
You have deployed the MSE Sync tool. For more information, see MSE Sync migration solution.
-
You have created an MSE ZooKeeper cluster. For more information, see Create a ZooKeeper engine.
Limitations
-
A failure in the MSE Sync tool can interrupt the synchronization service. For high availability, we recommend that you deploy at least two nodes for the tool. After you start the migration, complete all steps promptly.
-
Ensure network connectivity between the source ZooKeeper cluster, the MSE Sync tool, and the destination MSE ZooKeeper cluster.
Specifications
|
Dubbo services |
Providers |
Consumers |
Minimum instance specifications |
Minimum tool specifications |
|
0 to 1,000 |
0 to 3,000 |
0 to 9,000 |
2-core, 4 GB |
2-core, 4 GB |
|
1,000 to 4,000 |
0 to 12,000 |
0 to 36,000 |
4-core, 8 GB |
4-core, 8 GB |
|
4,000 to 7,000 |
0 to 21,000 |
0 to 63,000 |
8-core, 16 GB |
4-core, 8 GB |
|
7,000 to 10,000 |
0 to 30,000 |
0 to 90,000 |
16-core, 32 GB |
8-core, 16 GB |
-
Minimum instance specifications: We recommend deploying at least three nodes for a production environment and at least five nodes for a mission-critical environment.
-
Minimum tool specifications: For high availability, we recommend deploying at least two nodes.
Procedure
The following figure shows the deployment architecture for the migration.
Step 1: Create a synchronization task
-
In the left-side navigation pane of the MSE Sync tool, click Cluster configuration and then click Add Cluster. In the Add Cluster dialog box, configure the source ZooKeeper cluster and click OK.
Parameter
Description
Cluster Name
Enter a custom name for the cluster.
Cluster type
ZK
Cluster IP address list
Enter the IP address and port of each node in your source ZooKeeper cluster, one per line. The default port is 2181. For example:
127.0.0.1:2181 127.0.0.2:2181 127.0.0.3:2181If the source cluster uses a Server Load Balancer (SLB) instance for load balancing, enter the IP address and port of the SLB instance in the Cluster IP address list field.
-
Click Add Cluster again to add the destination ZooKeeper cluster.
-
Cluster type: Select ZK.
-
Cluster IP address list: Enter the endpoint and service port of the destination MSE ZooKeeper cluster. For example, mse-8b7de****-p.zk.mse.aliyuncs.com:2181.
Click Add Cluster, enter a Cluster Name (for example, MSE zk) in the dialog box, and then click OK.
-
-
In the left-side navigation pane, click Sync Task and then click New Sync to add the Dubbo services for migration.
-
Sync Method: Select Bidirectional. This enables bidirectional synchronization, which synchronizes changes between the source and destination clusters.
-
Synchronization Type: Select Service Information. MSE Sync automatically lists all services in the source cluster. Select the required services.
-
Group name: If you are synchronizing multiple services, you can leave this parameter empty. Otherwise, enter a specific Dubbo group name.
Select Source ZK from the Source Cluster drop-down list, select MSE zk from the Target Cluster drop-down list, select com.example.IHelloService from the service list, and then click OK.
-
-
Click OK.
On the Service Synchronization page of the migration tool, view the names of the synchronized services.
After the tasks are added, you can view the created synchronization tasks in the Synchronization Tasks list, including the source cluster, target cluster, task progress, and task type. When the task progress shows Synchronization Complete (Listening), the data has been synchronized and the source changes are continuously monitored.
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 Microservices Registry > Instances.
-
On the Instances page, click the name of the instance.
-
In the left-side navigation pane, choose . Verify that the services are listed under the default Dubbo path.
Step 3: Migrate the Dubbo clients
-
Change the endpoint in your Dubbo client configuration.
Locate the XML configuration file for your Dubbo client. In the
dubbo:registry addressattribute, replace the endpoint of your self-managed ZooKeeper with the endpoint of the MSE ZooKeeper registry.Before:
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>After:
<dubbo:registry address="zookeeper://mse-8b7de****-p.zk.mse.aliyuncs.com:2181"/> -
Restart the client applications. They will then connect to the MSE ZooKeeper registry.
NoteTo avoid service interruptions, we recommend restarting your clients in batches. After all clients are restarted, verify that they have disconnected from the source cluster.
Step 4: Decommission the source cluster
-
Shut down the source ZooKeeper cluster.
-
Stop the MSE Sync tool.