Help Center/ SoftWare Repository for Container/ Best Practices (Enterprise Edition)/ Cross-Region DR Using SWR Enterprise Edition/ Using SWR Enterprise Edition to Implement Cross-Region DR for Self-Built Harbor
Updated on 2025-11-07 GMT+08:00

Using SWR Enterprise Edition to Implement Cross-Region DR for Self-Built Harbor

If you need to implement remote DR for Harbor, you can use SWR Enterprise Edition. By leveraging the replication capability of Harbor, you can copy image artifacts from Harbor at a site to SWR Enterprise Edition at another site. If Harbor is abnormal, you can pull the image artifacts replicated by SWR Enterprise Edition for remote DR. To achieve this, you can take the following steps:

1. Synchronize images from Harbor to SWR Enterprise Edition.

2. Configure a custom domain name for remote DR.

Prerequisites

  • You have purchased an SWR Enterprise Edition instance. For details, see Buying a Repository.
  • You have set up Harbor, and the network between Harbor and SWR Enterprise Edition is connected.
  • The custom domain name of the SWR Enterprise Edition instance is the same as the Harbor domain name. For details about how to configure a custom domain name, see Domain Names.

Procedure

  1. Synchronize images from Harbor to SWR Enterprise Edition.
  1. Create a namespace.

    1. Log in to the SWR console. In the upper left corner, switch to your region.
    2. In the navigation pane, choose Namespaces. In the upper right corner, click Create Namespace.
    3. Enter the name of the target project in Harbor and select the namespace type.
    4. Click OK.

  2. Configure the destination image registry on Harbor.

    1. Create a registry endpoint.

      Table 1 Parameters for creating a registry endpoint

      Parameter

      Description

      Provider

      Select Docker Registry.

      Name

      Enter a custom name.

      Description

      Enter a description as needed.

      Endpoint URL

      Enter the domain name of the target SWR Enterprise Edition instance in the format of https://{address-of-of-the-SWR-Enterprise-Edition-instance}.

      To obtain the address, log in to the SWR console, switch to the target region in the upper left corner of the page. On the displayed page, click the name of the target repository to go to the repository details page. In the Basic Information area of the Dashboard page, obtain the access address.

      Access ID

      Username for accessing the instance. You can obtain the username from the table downloaded in Creating a Long-Term Credential.

      Access Secret

      Password for accessing the instance. You can obtain the password from the table downloaded in Creating a Long-Term Credential.

      Verify Remote Cert

      You are advised to deselect this option.

  3. Configure a replication rule.

    1. Choose Administration > Registries and then click NEW ENDPOINT.

    2. Configure the parameters.

      Table 2 Parameters for creating a replication rule

      Parameter

      Description

      Name

      Enter a custom name.

      Description

      Enter a description as needed.

      Replication mode

      Select Push-based. Images are pushed from the local Harbor to the destination registry.

      Source resource filter

      Filters images in Harbor based on the configuration. All resources are selected by default.

      Destination registry

      Select the registry endpoint created in 2.a.

      Destination

      Enter the name of the namespace created in 1. Flattening reduces the registry hierarchy during image replication. You are advised to select Flatten 1 Level.

      Triggering Mode

      Select an option as needed. You are advised to select Event Based.

      Bandwidth

      Set it to the maximum network bandwidth. –1 indicates that the network bandwidth is not limited.

      Overwrite

      If there are resources with the same name, specify whether to overwrite the resources at the destination.

    For more information, see the Harbor official website.

  4. Select the replication rule and click REPLICATE to replicate images.

  1. Configure a custom domain name for remote DR.

The following three scenarios are provided based on the network relationship between Harbor and SWR Enterprise Edition.

Assume that the SWR Enterprise Edition instance is in Guangzhou and the Harbor repository is in Shanghai. The table below describes three example scenarios.

Table 3 Remote DR scenarios

Scenario

Description

Remote DR Solution

Scenario 1

Harbor is deployed on Huawei Cloud, and SWR Enterprise Edition is accessed over the public network.

If Harbor in Shanghai becomes faulty and images cannot be pushed or pulled, you can modify the DNS settings of the custom domain name to pull images from SWR Enterprise Edition in Guangzhou.

The detailed operations are as follows:

  1. Log in to the DNS console. Switch to the CN East-Shanghai region.
  2. In the navigation pane, choose Private Zones.
  1. Locate the private zone created for the custom domain name of the SWR Enterprise Edition instance and associated with your VPC.
  2. On the Record Sets page, click the target record set.
  3. In the Modify Record Set dialog box, configure the parameters, and then click OK.
    • Type: Select CNAME.
    • Name: Enter the prefix of the custom domain name.
    • Value: Enter the default domain name of the SWR Enterprise Edition instance in the CN South-Guangzhou region.
    • TTL: Retain the default value.

Scenario 2

Harbor is not deployed on Huawei Cloud, and SWR Enterprise Edition is accessed over the public network.

If Harbor becomes faulty, you cannot push or pull images. In this case, take the following steps:

  1. Access the SWR Enterprise Edition instance over the public network. For more information, see Public Network Access.
  2. Configure the DNS resolution to map the domain name to the public IP address of the SWR Enterprise Edition instance.
  3. Set the custom domain name of the SWR Enterprise Edition instance to the domain name used by Harbor.

Scenario 3

Harbor is not deployed on Huawei Cloud, and SWR Enterprise Edition is accessed over a private network.

If Harbor becomes faulty, you cannot push or pull images. In this case, take the following steps:

  1. Obtain the IP address of the SWR Enterprise Edition instance.
  2. Configure the routes and DNS resolution.
  3. Point the domain name of Harbor to the IP address of the SWR Enterprise Edition instance.