Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ DR Management/ Establishing a DR Relationship
Updated on 2025-08-11 GMT+08:00

Establishing a DR Relationship

Function

This API is used to establish a DR relationship. Before calling this API:

Constraints

This request is initiated from the primary instance.

URI

POST /v3.5/{project_id}/instances/{instance_id}/disaster-recovery/construct

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

disaster_type

Yes

String

Definition

DR type.

Constraints

N/A

Range

  • stream: streaming DR.

Default Value

N/A

dr_ip

Yes

String

Definition

Data IP address of the peer instance. To obtain the value, see Querying DB Instances.

  • Centralized instances: data IP address of any node of the peer instance (The node cannot be an arbitration or log node)
  • Distributed instances: data IP address of a CN of the peer instance.

Constraints

N/A

Range

N/A

Default Value

N/A

dr_user_name

Yes

String

Definition

Account name of the peer instance.

Constraints

N/A

Range

N/A

Default Value

N/A

dr_user_password

Yes

String

Definition

Password of the peer instance account.

Constraints

N/A

Range

N/A

Default Value

N/A

dr_task_name

No

String

Definition

DR task name.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

job_id

String

Definition

Job ID.

Range

N/A

Example Request

POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.5/0483b6b16e954cb88930a360d2c4e663/instances/9089bbf7377442daa55bc28d514c08bdin14/disaster-recovery/construct
{ 
   "disaster_type" : "stream", 
   "dr_ip" : "127.0.0.1", 
   "dr_user_name" : "root", 
   "dr_user_password" : "password",
   "dr_task_name": "dr-task-123" 
 }

Example Response

{
"job_id":"8bf0175e-562e-45f6-942a-2e2c72c577d7"
}

Status Codes

Error Codes

For details, see Error Codes.