Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. Introduction

Activating the standby is a simple and straightforward process. This is done during true DR scenarios or for DR testing.

The configuration is reversed for true DR scenarios after activation, and the original primary should be dropped and recreated as standby.

The standby can be activated once the activity is completed for DR testing purposes. Below are the steps that need to be performed.

  1. Drop the activated standby cluster.

  2. Remove the configuration

  3. Create the configuration again.

  4. Re-create the DR cluster.

Info

The Activation process is same across all three modes of DR methods

  1. WAL Streaming

  2. WAL Archiving

  3. WAL Shipping

Only one example is shown below.

2. Technical Explanation

  1. Database Status

    1. Standby server should be “HOT STANDBY“/”WARM STANDBY”

Drawio
lbox
mVer2
zoom1
simple0
zoominComment10
inCommentcustContentId03679617036
pageId3673260337
custContentIdlbox36796170361
diagramDisplayNameUntitled Diagram-1692929625168.drawio
1contentVer2
revision2
baseUrlhttps://dbvisit.atlassian.net/wiki
diagramNameUntitled Diagram-1692929625168.drawio
pCenter0
width1006.1060606060603
links
tbstyle
height1072.1060606060607

...

  1. Trigger Activate

  2. Disable Control Center Behaviors

    • Disable Observer: Turn off the observer node to ensure a smooth switchover without conflicting activities

    • Disable Auto Update: Suspend any automatic update processes during the switchover procedure

  3. Promote Standby database to Primary database

    Code Block
    pg_ctl promote -D data_dir
    • The standby server stops streaming data replication from the primary server.

    • The standby server disconnects from the primary server.

    • The standby server modifies its own configuration to become a primary server.

    • The standby server starts accepting read and write operations.

    • Clients and applications that were connecting to the old primary server may need to be reconfigured to connect to the newly promoted primary server.

  4. Switch Role and Persist new configuration data with failover mark

  5. Enable Control Center Behaviors

    • Enable Observer

    • Enable Auto Update: Restore the automatic update processes

  6. Execute User Script on New Primary and Standby Servers

    • Run any necessary user scripts on the new primary and new standby servers to complete the switchover process.

3. Activate Standby

  1. The standby cluster is ready for activation

  2. Option to have custom scripts that can be run on both existing primary and standby host servers.

2. Click Activate to start the activation process. This would ask for further confirmation to activate the standby cluster.

Image Added

Image AddedImage Added

  1. Post activation the configuration status changes to “ IN FAILOVER STATE.”

  2. The original standby server is now changed to ONLINE status, and this server acts as the primary cluster server.

  3. The original primary server status is now ONLINE (Usually in a true DR scenario the status would be offline)

...

4. Recover from Failover

This procedure is used to re-create the standby cluster on the original primary.

  1. The configuration status IN FAILOVER STATE. The original standby is the new primary.

  2. The status of the original primary is down.

  3. The configuration is confirmed to be ready for recovery from failover.

  4. Click on “Recover From Failover” to start the process.

Image Added

After the above process completes, log in on the server and clean up the data directory of the old primary. The option to set up the DR database will appear and click on the“Set up now?” to create the DR cluster on the original primary.

...