Updated on 2024-10-24 GMT+08:00

Creating a DR Relationship

Scenarios

After a cross-region DR relationship is created, if the region where the primary instance is located encounters a natural disaster and cannot be connected, you can promote the DR instance in another region to primary. To connect to the new primary instance, you only need to change the connection address on the application side.

How Cross-Region DR Works

Two RDS for PostgreSQL instances are deployed in two data centers, one in the production center and the other in the DR center. The RDS DR function replicates data from the primary instance in the production center to the DR instance in the DR center, keeping data synchronous across the regions.

Figure 1 Topology

Precautions

  • Before using this function, ensure that the network between the DB instances in two different regions is connected. You can create a cloud connection to connect the VPCs in different regions.
  • Before using this function, ensure that the primary instance and DR instance are available and are deployed in different regions. The primary instance uses a primary/standby deployment and the DR instance uses a single-node deployment.
  • The CPU, memory, and storage space of the DR instance must be greater than or equal to those of the primary instance.
  • After a DR relationship is set up, you can change the instance class of the DR instance. To use this function, contact customer service.
  • After changing the database port or private IP address of the primary instance, you need to re-establish the DR relationship.
  • RDS for PostgreSQL 12 and later versions support cross-region DR.
  • Modifying a parameter of the primary instance do not modify that of the DR instance synchronously. You need to modify the parameter of the DR instance separately based on service requirements.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. Paste the information of the DR instance to the primary instance and configure the DR capability of the primary instance.

    1. On the Instances page, click the name of an instance (as DR instance) that you want to create a DR relationship for.
    2. Click DR Information.
    3. In the displayed dialog box, click Copy.
    4. On the Instances page, select another instance (as primary instance) and choose More > Create DR Relationship.
    5. On the displayed page, confirm the information and click Create DR Relationship.
    6. In the displayed dialog box, paste the information you copied in 4.c to the text box and click OK.
    7. Check the task execution result on the Task Center page. If the task status is Completed, the DR capability is successfully configured for the primary instance. Perform subsequent operations only after this task is successfully executed.

  5. Paste the information of the primary instance to the DR instance and configure the DR capability of the DR instance.

    1. On the Instances page, click the name of the primary instance.
    2. Click DR Information.
    3. In the displayed dialog box, click Copy.
    4. On the Instances page, select the DR instance and choose More > Create DR Relationship.
    5. On the displayed page, confirm the information and click Create DR Relationship.
    6. In the displayed dialog box, paste the information you copied in 5.c to the text box and click OK.
    7. Check the task execution result on the Task Center page. If the task status is Completed, the DR capability is successfully configured for the DR instance. After this task is successfully executed, the DR relationship is created.

  6. On the Instances page, click the name of the DR instance.
  7. In the navigation pane on the left, choose DR Management. The DR replication status of the DR instance is displayed.