Registry synchronization

更新时间:
复制 MD 格式

This topic explains how to configure a registry synchronization task.

Prerequisites

You have configured a registry synchronization cluster. For more information, see Registry Synchronization Cluster.

Procedure

  1. Log on to the AHAS console.

  2. In the navigation pane on the left, click Multi-active Disaster Recovery.

  3. In the left navigation bar, click Multi-active Instance to go to the Multi-active Instance list page.

  4. Select the target multi-active instance.

  5. In the navigation pane on the left, choose Service Layer Configuration and then Registry Synchronization Configuration.

  6. On the Registry Synchronization Configuration page, click Add Synchronization Task.

    • Add a Nacos-to-Nacos synchronization task

      1. On the Add Synchronization Task page, specify the following parameters:

        Parameter

        Description

        Synchronization cluster

        Select a synchronization cluster. For more information, see Registry Synchronization Cluster.

        Source registry

        Select the source registry. For more information, see Registry Synchronization Cluster.

        Destination registry

        Select the destination registry. For more information, see Registry Synchronization Cluster.

        Namespace

        • Enter the ID of the Nacos namespace. For more information, see Create a namespace.

        • If you leave this parameter empty, it defaults to public.

        Important

        When you synchronize data between Nacos registries, the source and destination registries must have the same namespace ID. Nacos 1.2 and later supports custom namespace IDs.

        Group name

        • Enter the Nacos group name.

        • If you leave this parameter empty, it defaults to DEFAULT_GROUP.

        Service name

        • The service name you enter must match the one in the registry.

        • You can enter multiple service names to synchronize. Separate them with commas (,).

        Note

        When you use a Nacos registry as the source, you can view all service names under the specified namespace and group name. You can also click Select Service Name and select one or more services on the Select Service Name page.

      2. Click OK.

    • Add a ZooKeeper-to-ZooKeeper synchronization task

      Note

      ZooKeeper registry synchronization supports only Dubbo services.

      1. On the Add Synchronization Task page, specify the following parameters:

        Parameter

        Description

        Synchronization cluster

        Select a synchronization cluster. For more information, see Registry Synchronization Cluster.

        Source registry

        Select the source registry. For more information, see Registry Synchronization Cluster.

        Destination registry

        Select the destination registry. For more information, see Registry Synchronization Cluster.

        Group name

        Enter the ZooKeeper group name.

        Note

        The group name corresponds to the group of a Dubbo service. If you leave this empty, the task synchronizes services from all groups.

        Version

        Enter the service version.

        Note

        This parameter corresponds to the version of a Dubbo service. If you leave this empty, the task synchronizes services of all versions.

        Service name

        • The service name you enter must match the one in the registry.

        • You can enter multiple service names to synchronize. Separate them with commas (,).

        • For ZooKeeper-to-ZooKeeper synchronization tasks, you can synchronize all services. To do this, enter an asterisk (*) in the Service name field. The task synchronizes all services that match the specified group and version.

          Note

          MSHA does not currently support displaying all service names from a ZooKeeper source registry.

      2. Click Confirm.

    • Batch creation

      • If you enter multiple services at once, the MSHA console creates the tasks asynchronously. The running status of these tasks is displayed as Creating Synchronization Task.

      • When the task status changes to Synchronizing, the service has been successfully synchronized from the source to the destination registry.

After you configure registry synchronization, you can perform the following operations on the Registry Synchronization Configuration page:

  • Pause synchronization task: Select a synchronization configuration task whose running status is Running, and click Pause. After the task is paused, microservice synchronization stops, and the service is deregistered from the destination registry. When the status of the synchronization task is Paused, the task is stopped.

    Note

    Pausing and deleting a task have the same immediate effect: they both stop service synchronization. However, deleting a task also removes its information from the MSHA console and RDS. To avoid re-entering task details, we recommend pausing tasks instead of deleting them unless necessary.

  • Resume a synchronization task: Select a task with a Running Status of Paused and click Resynchronize. The Running Status changes to Synchronizing, and the service synchronizes again from the source registry to the destination registry.

  • Delete a synchronization task: Select the task you want to delete and click Delete. In the Confirm Deletion dialog box, click OK. After a task is deleted, microservice synchronization stops, and the task is removed from the page.

    Important

    When you delete multiple tasks in a batch, some tasks may not stop synchronizing correctly. To safely delete tasks in a batch, first pause all the selected tasks, and then delete them.

  • Retry a synchronization task: For a task with a Running Status of Task Creation Failed or Creation Timed Out, click Retry. If the task still fails after multiple retries, check whether the health check of the ECS instance passes.

  • Batch operations: You can select multiple synchronization tasks to pause, resynchronize, or delete them in a batch. Batch operations run asynchronously and may take some time to complete.