All Products
Search
Document Center

Microservices Engine:Migrate service registries with MSE Sync

Last Updated:Feb 28, 2026

MSE Sync synchronizes service and configuration data between registries such as Nacos, ZooKeeper, Eureka, and Consul. Built on the open-source NacosSync project, MSE Sync supports bidirectional synchronization, automatic service discovery, and one-click full-service sync, enabling smooth migrations from self-managed registries to Microservices Engine (MSE) instances.

How it works

MSE Sync acts as a bridge between a source registry and a target MSE instance. During migration, it continuously synchronizes service registration data so that both registries serve identical information. Applications connected to either registry can discover services registered on the other, allowing you to migrate applications incrementally.

In the following diagram, pub represents a service publisher and sub represents a service subscriber.

Smooth migration

MSE Sync uses a multi-instance deployment architecture for high availability. If a node fails, healthy nodes run a scheduled recovery task to take over the failed node's synchronization work.

Multi-instance deployment

Key concepts

ConceptDescription
ClusterA source or target registry instance defined in the MSE Sync configuration. Each cluster has a unique name, a type (Nacos, ZooKeeper, Eureka, or Consul), and one or more connection endpoints.
TaskA synchronization job that moves data from a source cluster to a destination cluster. Each task specifies the sync type, direction, and an optional service name filter.
Sync typeDetermines what data is synchronized. Service syncs service registration data. Config syncs configuration data (Nacos and ZooKeeper only). All creates both service and configuration sync tasks based on the source cluster type.
Sync modeUnidirectional copies natively registered service data from the source to the target. Bidirectional syncs natively registered service data in both directions.

Supported migration paths

MSE Sync is compatible with the service registration logic of ZooKeeper, Nacos, Eureka, and Consul.

Supported registry types
Source registryTarget registryWhat gets synchronized
NacosNacosNative Nacos service data
ZooKeeperZooKeeperServices and persistent configurations
EurekaNacosNative Eureka service data
ConsulNacosNative Consul service data (healthy instances only)

ZooKeeper

Important

Do not modify the same Znode in both the source and target clusters simultaneously. Concurrent writes can cause data loss during migration. Do not use configuration synchronization to sync services or ephemeral nodes.

When synchronizing persistent nodes, MSE Sync registers a watch on the source cluster for each Znode. If the source cluster contains many nodes, this creates a large number of watches and consumes significant memory. Make sure the source cluster's Znode count and resources can handle the additional watch listeners from MSE Sync.

Eureka to Nacos

Eureka registers service names in uppercase by default (for example, SERVICE-1). MSE Sync converts these names to lowercase when synchronizing to Nacos (for example, service-1).

This conversion can cause interoperability issues with mixed-case names. For example, if a service named Service-1 is registered directly in Nacos alongside the synchronized service-1, Nacos treats them as two separate services. Instances registered under one name cannot discover instances under the other.

To avoid this issue, standardize all service names to lowercase before starting the migration.

Consul to Nacos

MSE Sync synchronizes only healthy instance information from Consul. Metadata changes are not detected or synchronized automatically. Consul configuration data is not supported.

Step 1: Deploy MSE Sync

Before deploying, make sure that:

  • The MSE Sync deployment environment has network connectivity to both the source and target registries (for example, deploy MSE Sync in the same Virtual Private Cloud (VPC) or make sure it has public internet access to both clusters)

  • (If using MySQL) A MySQL service is available with a database and a user account that has read and write permissions

Important

MSE Sync must connect to both the source and target registries. If it cannot reach both, the migration fails.

Choose a storage backend

MSE Sync supports two storage backends:

BackendUse whenMulti-instance support
MySQL (required for multi-instance deployment)Running multiple MSE Sync instances for high availabilityYes -- multiple instances share one MySQL database
Embedded DerbyTesting or single-node deploymentsNo -- single machine only

MSE Sync automatically selects the backend based on environment variables. If MYSQL_URL, MYSQL_USER_NAME, and MYSQL_PASSWORD are all set, MSE Sync connects to MySQL. Otherwise, it uses the embedded Derby database.

VariableDescriptionExample
MYSQL_URLMySQL connection stringjdbc:mysql://localhost:3306/sync
MYSQL_USER_NAMEUsername with read and write permissions--
MYSQL_PASSWORDPassword for the account--

Configure JVM parameters

Add JVM parameters in the conf/java.env file using the JAVA_OPT variable:

JAVA_OPT="$JAVA_OPT -Xms2048m -Xmx2048m"

Deploy on Kubernetes

  1. Save the following configuration as mse-sync-deployment.yaml. Replace the MySQL connection details and adjust replicas as needed.

    Note

    To access the MSE Sync web UI, create a Kubernetes Service that routes traffic to port 8000.

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      labels:
        app.kubernetes.io/name: mse-sync
      name: mse-sync-svc
    spec:
      replicas: 3
      selector:
        matchLabels:
          app.kubernetes.io/name: mse-sync
      template:
        metadata:
          labels:
            app.kubernetes.io/name: mse-sync
        spec:
          containers:
          - name: mse-sync
            image: msecrinstance-registry.cn-hangzhou.cr.aliyuncs.com/mse-demo/mse-sync:latest
            ports:
            - containerPort: 8000
            env:
            - name: MYSQL_URL
              value: "jdbc:mysql://192.xx.xx.xx:3306/sync"
            - name: MYSQL_USER_NAME
              value: "mse-sync"
            - name: MYSQL_PASSWORD
              value: password
  2. Deploy MSE Sync:

    kubectl apply -f mse-sync-deployment.yaml

Deploy on Elastic Compute Service (ECS)

  1. Download the MSE Sync binary:

    curl https://msesync.oss-cn-hangzhou.aliyuncs.com/MseSync.zip --output msesync.zip
  2. Extract the package:

    unzip ./msesync.zip
  3. (Optional) If using MySQL, set the database environment variables:

    export MYSQL_URL=""
    export MYSQL_USER_NAME=""
    export MYSQL_PASSWORD=""
  4. Start MSE Sync:

    ./MseSync/bin/startup.sh start

Step 2: Configure clusters and sync tasks

MSE Sync supports three configuration methods:

MethodBest forDetails
Configuration file (recommended)Automated or large-scale migrationsDefine clusters and tasks in YAML; import via CLI or auto-load on startup
Web UIAd-hoc or small-scale migrationsImport configuration through the browser-based interface
MSE consoleGenerating initial configuration filesThe Cloud Migration page auto-generates YAML configuration files

Option A: Configure with a YAML file

A configuration file contains two sections: clusters (registry connection details) and tasks (synchronization jobs).

The following example synchronizes all services from the public and test namespaces in the source cluster to the destination cluster, using bidirectional sync:

clusters:
  - clusterName: src
    connectKeyList:
      - mse-xxxxx-nacos-ans.mse.aliyuncs.com:8848
    clusterType: NACOS
    namespace: public,test
  - clusterName: dst
    connectKeyList:
      - mse-xxxxxx-nacos-ans.mse.aliyuncs.com:8848
    clusterType: NACOS

tasks:
  - source: src
    destination: dst
    type: Service
    mode: Bidirectional
    serviceMatchPattern: ".*"
    autoScanAndAddService: true

Import the configuration using the CLI:

./bin/msesyncCMD.sh apply -f {path_to_configuration_file}

Alternatively, place the file at MseSync/conf/config.yaml. MSE Sync loads it automatically on startup.

Note

When importing a configuration file, newly added services are automatically discovered and synchronized.

Option B: Configure through the web UI

  1. Open the MSE Sync web interface.

  2. In the left navigation pane, click Service Sync.

  3. Click Import Configuration.

  4. In the Import Configuration dialog box, paste the YAML configuration and click OK.

Configuration reference

Cluster fields

FieldDescriptionExample
clusterNameUnique name for the cluster. Once set, do not change this value.sourceCluster
clusterTypeRegistry type: NACOS, ZOOKEEPER, EUREKA, or CONSULNACOS
namespaceNacos namespace name. Separate multiple namespaces with commas. If left blank on a source cluster, data from all namespaces is synchronized.public,test
connectKeyListList of connection endpoints for the cluster.See example below
userNameNacos username (if authentication is enabled).--
passwordNacos password (if authentication is enabled).--
akAccessKey ID for authenticating with a cloud MSE Nacos instance.LTAI5***dXai6
skAccessKey secret for authenticating with a cloud MSE Nacos instance.Jdvdj***6vs7wBEKO

connectKeyList example:

connectKeyList:
  - localhost:8848
  - localhost1:8848

Task fields

FieldDescriptionDefault
sourceName of the source cluster (must match a clusterName in the clusters section).--
destinationName of the target cluster. The target namespace is automatically kept consistent with the source. If the namespace does not exist in the target, MSE Sync creates it.--
typeSync type: Service (service data), Config (configuration data, Nacos and ZooKeeper only), or All (both).--
modeSync direction: Unidirectional (source to target only) or Bidirectional (both directions).--
serviceMatchPatternRegular expression to filter which services to synchronize..* (all services)
autoScanAndAddServiceAutomatically discover and synchronize new services added to the source cluster.true

Multi-instance deployment

For production environments, deploy multiple MSE Sync instances backed by a shared MySQL database. If one node fails, the remaining healthy nodes detect the failure through a scheduled task and take over the failed node's sync work.

Recovery scan interval

The recovery scan interval controls how frequently healthy nodes check for failed nodes. Configure it with the following Java Virtual Machine (JVM) parameter, set through the JAVA_OPT environment variable:

-Dmsesync.daemon.refresh.interval=60  // Unit: seconds

Example:

JAVA_OPT="$JAVA_OPT -Dmsesync.daemon.refresh.interval=10"
Important
  • The default interval is 60 seconds. Do not set it too low -- a short interval increases load on both the server and MSE Sync nodes. The minimum recommended value is 10 seconds. Adjust based on cluster load and sync volume.

  • Do not use multi-instance deployment for configuration synchronization tasks.

During the interval between a node failure and the next scheduled recovery scan, the client's instance list may be temporarily empty.

Usage notes

  • Bidirectional sync and offline status: During bidirectional synchronization, if a service provider is taken offline from the target instance's console, the offline status is not propagated back to the source instance.

  • Cluster name immutability: Once a clusterName is set in the configuration, do not change it. Changing it can prevent sync tasks from resuming after a restart.

FAQ

A sync task was added through the UI or YAML file, but it does not appear in the task list.

Check that services exist in the source cluster's namespace. MSE Sync only creates sync tasks for services it can discover. Verify:

  1. The cluster connection details are correct (endpoints, authentication credentials).

  2. The namespace ID matches an existing namespace in the source cluster.

  3. At least one service instance (service provider) is registered in the specified namespace.

During bidirectional sync, taking a service provider offline from the target console does not sync back to the source.

This is expected behavior. The offline status set through the target instance's console is not synchronized to the source instance.

Description of additional YAML configuration fields

  • Clusters field:

    Field

    Description

    Example value

    namespace

    The Nacos namespace name.

    Note: You can enter multiple namespaces, separated by commas. If this field is left empty and the instance is the synchronization source, data from all namespaces in the instance is synchronized.

    • public

    • test

    • test1

    ak

    The AccessKey for authenticating the cloud MSE Nacos instance.

    LTAI5***********dXai6

    sk

    The AccessKey secret for authenticating the cloud MSE Nacos instance.

    Jdvdj*************6vs7wBEKO