Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Dual-Cluster DR Control Functions

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

Dual-cluster DR control functions can be used to create an archive slot, which specifies the OBS information for storing physical logs.

  • pg_create_physical_replication_slot_extern(slotname text, dummy_standby bool, extra_content text, need_recycle_xlog bool)

    Description: Creates an OBS or a NAS archive slot. slotname indicates the slot name of the DR standby. The primary and standby nodes must use the same slot name. dummy_standby specifies whether the database is deployed in primary/standby/secondary mode or one-primary and multi-standby mode. The value false indicates that the database is deployed in one-primary and multi-standby mode, and the value true indicates that the database is deployed in primary/standby/secondary mode. extra_content contains some information about the archive slot. For an OBS archive slot, the format is OBS;obs_server_ip;obs_bucket_name;obs_ak;obs_sk;archive_path;is_recovery;is_vote_replicate, where OBS indicates the archive media of the archive slot, obs_server_ip indicates the IP address of OBS, obs_bucket_name indicates the bucket name, obs_ak indicates the AK of OBS, obs_sk indicates the SK of OBS, archive_path indicates the archive path i, and is_recovery indicates whether the slot is an archive slot or a recovery slot. The value 0 indicates that the slot is an archive slot and is used by the primary database instance. The value 1 indicates that the slot is a recovery slot and is used by the DR database instance. is_vote_replicate indicates whether the voting copy is archived first. The value 0 indicates that the synchronous standby server is archived first, and the value 1 indicates that the voting copy is archived first. This field is reserved in the current version and is not adapted yet. For a NAS archive slot, the format is NAS;archive_path;is_recovery;is_vote_replicate. Compared with the OBS archive slot, the NAS archive slot does not have the OBS configuration information, while the meanings of other fields are the same.

    If the media is not specified, the OBS archive slot is used by default. The extra_content format is obs_server_ip;obs_bucket_name;obs_ak;obs_sk;archive_path;is_recovery;is_vote_replicate.

    need_recycle_xlog specifies whether to recycle old archived logs when creating an archive slot. The value true indicates that old archived logs are recycled, and the value false indicates that old archive logs are not recycled.

    Return type: records, including slotname and xlog_position of the current DR standby.

    Note: Users who invoke this function must have the SYSADMIN permission or the REPLICATION permission, or inherit the gs_role_replication permission of the built-in role.

    Example:

    Create an OBS archive slot.

    1
    2
    3
    4
    5
    openGauss=# select * from pg_create_physical_replication_slot_extern('uuid', false, 'OBS;obs.cn-north-7.ulanqab.huawei.com;dyk;19D772JBCACXX3KWS51D;********;openGauss_uuid/dn1;0;0', false);
     slotname | xlog_position
    ----------+---------------
     uuid     |
    (1 row)
    

    Create a NAS archive slot.

    1
    2
    3
    4
    openGauss=# select * from pg_create_physical_replication_slot_extern('uuid', false, 'NAS;/data/nas/media/openGauss_uuid/dn1;0;0', false);
     slotname | xlog_position
    ----------+---------------
     uuid     |
    
  • gs_set_obs_delete_location(delete_location text)

    Description: Sets the location where OBS archive logs can be deleted. The value of delete_location is a LSN. The logs before this location have been replayed and flushed to disks in the DR cluster and can be deleted on OBS.

    Return type: xlog_file_name text, indicating the file name of the logs that can be deleted. The value of this parameter is returned regardless of whether OBS is deleted successfully.

    openGauss=# select gs_set_obs_delete_location('0/54000000');
     gs_set_obs_delete_location  
    -----------------------------
     000000010000000000000054_00
    (1 row)
  • gs_hadr_do_switchover()

    Description: Triggers a planned switchover in the primary cluster in the geo-redundancy scenario.

    Return type: Boolean, indicating whether the switchover process is performed normally and whether services are taken over successfully.

  • gs_set_obs_delete_location_with_slotname(cstring, cstring )

    Description: Sets the location where OBS archive logs can be deleted in a DR relationship. The first parameter indicates the LSN. The logs before this location have been replayed and flushed to disks in the DR database instance and can be deleted on OBS. The second parameter indicates the name of the archive slot.

    Return type: xlog_file_name text, indicating the file name of the logs that can be deleted. The value of this parameter is returned regardless of whether OBS is deleted successfully.

  • gs_streaming_dr_in_switchover()

    Description: Triggers a planned switchover in the primary cluster in remote DR solutions based on streaming replication.

    Return type: Boolean, indicating whether the switchover process is performed normally and whether services are taken over successfully.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback