When you move from a self-managed ZooKeeper cluster to Alibaba Cloud Microservices Engine (MSE), you need to migrate persistent znode data without data loss. MSE Sync handles this by creating a bidirectional sync task between your source cluster and the MSE ZooKeeper instance, so both sides stay in sync until you complete the cutover.
This guide covers cluster registration, sync task creation, data verification, and cutover.
Limitations
Review these constraints before you start. This migration method has strict boundaries on what data it can handle and how MSE Sync operates.
Persistent znodes only. Do not use this method to migrate service data, distributed locks, or ephemeral node data.
Network connectivity required. The self-managed ZooKeeper cluster, MSE Sync, and the MSE ZooKeeper instance must communicate over the network.
MSE Sync availability. If MSE Sync goes down, synchronization stops. Deploy MSE Sync on at least two nodes to prevent a single point of failure, and complete the migration promptly after it starts.
Prerequisites
Before you begin, make sure that you have:
An MSE ZooKeeper instance. See Create a ZooKeeper engine
The MSE Sync tool deployed and running. See Migration by using MSE Sync
Verified network connectivity between your self-managed ZooKeeper cluster, MSE Sync, and the MSE ZooKeeper instance
Step 1: Register the source and destination clusters
Register both your self-managed ZooKeeper cluster and the MSE ZooKeeper instance in MSE Sync before you create a sync task.
Add the source cluster
In the left-side navigation pane of MSE Sync, click Cluster Configuration.
Click Add Cluster.
In the Add Cluster dialog box, configure the following parameters:
NoteIf your source cluster uses a Server Load Balancer (SLB) instance, enter the SLB IP address and port instead.
Parameter Description Cluster Name A custom name for your self-managed ZooKeeper cluster Cluster Type Select ZK Cluster IP Address List Enter IP address and port combinations for your ZooKeeper nodes, one per line. The default port is 2181. Example: 127.0.0.1:2181127.0.0.2:2181127.0.0.3:2181Click OK.
Add the destination cluster
Click Add Cluster again.
Configure the following parameters:
Parameter Description Cluster Name A custom name for the MSE ZooKeeper instance Cluster Type Select ZK Cluster IP Address List Enter the endpoint and service port of your MSE ZooKeeper instance. Example: mse-8b7de****-p.zk.mse.aliyuncs.com:2181Click OK.
Step 2: Create a sync task
In the left-side navigation pane of MSE Sync, click Service Synchronization.
Click New Sync.
In the New Sync dialog box, configure the following parameters:
ImportantBidirectional sync writes destination changes back to the source cluster. This may overwrite data or delete ephemeral nodes on the source. Evaluate the risk before you select this mode.
Parameter Description Sync Mode Select Bidirection. Changes on either the source or destination trigger synchronization in both directions. Sync Type Select Config. MSE Sync displays the configurations of all services registered with the self-managed ZooKeeper cluster. Select the configurations to migrate based on your requirements. Path The znode path on the self-managed ZooKeeper cluster where the persistent data to migrate is stored. Click OK.
The sync task appears on the Service Synchronization page.
Step 3: Verify the migration
After the sync task starts, confirm that the persistent data has been replicated to the MSE ZooKeeper instance.
Log on to the MSE console.
In the top navigation bar, select the region of your MSE ZooKeeper instance.
In the left-side navigation pane, choose Microservices Registry > Instances.
Click the name of your MSE ZooKeeper instance.
In the left-side navigation pane, choose Data Management > Znodes.
Compare the znode tree with your source cluster to confirm that all expected persistent znodes and their data have been synchronized.
Spot-check a few znodes with known values to validate data integrity beyond a structural comparison.
Step 4: Complete the cutover
After you verify that all persistent data has been synchronized:
Shut down the self-managed ZooKeeper cluster.
Disable MSE Sync.
What's next
Monitor the MSE ZooKeeper instance for application connectivity and data integrity after the cutover.
For ongoing ZooKeeper management, see the MSE ZooKeeper documentation.