Migrating ZooKeeper persistent data

更新时间:
复制 MD 格式

This topic describes how to use MSE Sync to migrate persistent data from a self-managed ZooKeeper to an MSE ZooKeeper instance.

Prerequisites

Limitations

  • If MSE Sync fails, the synchronization service is interrupted. We recommend that you deploy at least two nodes for high availability. After you start the migration, complete it as soon as possible.

  • Ensure that your self-managed ZooKeeper, MSE Sync, and MSE ZooKeeper instance can communicate over the network.

  • Do not use this method to synchronize service data, distributed locks, or ephemeral nodes.

Procedure

The following figure shows the deployment architecture.部署结构

Step 1: Add the cluster information

  1. In the MSE Sync left-side navigation pane, click Cluster configuration and then Add Cluster. In the Add Cluster dialog box, enter the information for the source ZooKeeper cluster and click OK.

    Parameter

    Description

    Cluster Name

    A custom cluster name.

    Cluster type

    ZK

    Cluster IP address list

    Enter the IP addresses and ports of the source ZooKeeper servers. Place each entry on a new line. The default port is 2181. For example:

    127.0.0.1:2181
    127.0.0.2:2181
    127.0.0.3:2181

    If the source cluster uses a Server Load Balancer (SLB) instance, enter the IP address and port of the SLB instance in the Cluster IP address list field.

  2. Click Add Cluster again to add the target ZooKeeper cluster information.

    • Cluster type: Select ZK.

    • Cluster IP address list: Enter the endpoint and service port of the destination MSE ZooKeeper instance. For example, mse-8b7de****-p.zk.mse.aliyuncs.com:2181.

    Click Add Cluster, enter a cluster name (for example, MSE zk), and click OK after you complete all configurations.

  3. In the left-side navigation pane, click Service Synchronization. Then, click New Sync to add the ZooKeeper path that you want to migrate.

    • Synchronously: Select bidirectional synchronization. In this mode, changes made on either cluster are synchronized to the other.

      Important

      With bidirectional synchronization, data from the destination cluster is also synchronized back to the source, which can alter your original data. Concurrently modifying data or synchronizing ephemeral nodes can cause data corruption or deletion in the source cluster. Proceed with caution.

    • Synchronization Type: Select Configuration. MSE Sync automatically lists all services from the source cluster. You can select the required services.

    • Path: Enter the specific ZooKeeper path.

  4. Click OK.

    On the Service synchronization page in the MSE Sync console, you can view the paths that are being synchronized.

Step 2: Verify the synchronization

  1. Log on to the MSE console, and select a region in the top navigation bar.

  2. In the left-side navigation pane, choose Microservices Registry > Instances.

  3. On the Instances page, click the name of the instance.

  4. In the navigation pane on the left, choose Data Management > Znodes. Verify that data from the source cluster has synchronized to the destination instance.

Step 3: Decommission the self-managed ZooKeeper cluster

  1. Stop the self-managed ZooKeeper cluster.

  2. Stop MSE Sync.