switchover
- Vijayganesh Sivaprakasam
Owned by Vijayganesh Sivaprakasam
Nov 20, 2024
2 min read
Loading data...
dbvcli switchover {-d|--name} CONFIGURATION_NAME [--OPTIONS]
Swap the roles of the primary and standby clusters
Option | Type | Description |
---|
Option | Type | Description |
---|---|---|
| key=val | optional script or scripts to execute after switchover on primary or standby host (key must be primary or standby host; value must be an existing user script) |
-bash-4.2$ ./dbvcli -d PG5432 switchover
Connecting to the Control Center at centlin72.oraclekiwi.co.nz:4433 ✓
Checking available actions for this configuration ✓
Configuration PG5432 (centlin71.oraclekiwi.co.nz -> centlin72.oraclekiwi.co.nz)
┌───────────────┐┌───────────────┐
│ ││ │
│ Primary ││ Standby │
│ ││ │
│ ONLINE ││ HOT STANDBY │
│ ││ │
└───────────────┘└───────────────┘
Gathering information required for switchover ✓
Optional User Scripts 1/2
There are no scripts defined for host centlin72.oraclekiwi.co.nz
Optional User Scripts 2/2
There are no scripts defined for host centlin71.oraclekiwi.co.nz
Confirmation
This configuration is ready for switchover. Select Yes to proceed with swapping
the roles of the primary and standby databases, or No to cancel the operation.
Confirm Switchover:
(•) Yes
( ) No
2024-11-01 13:35:51
2024-11-01 13:35:51 Preparing for switchover
2024-11-01 13:35:51 Disabling Observer
2024-11-01 13:35:51 done
2024-11-01 13:35:51 Switching cluster from primary to standby
2024-11-01 13:35:51 Using pg_ctl to stop cluster at /u01/PG5432 on 5432...
2024-11-01 13:35:51 pg_ctl: waiting for server to shut down.... done
2024-11-01 13:35:51 pg_ctl: server stopped
2024-11-01 13:35:51 done
2024-11-01 13:35:51 Setting to standby
2024-11-01 13:35:52 done
2024-11-01 13:35:52 Switching cluster from standby to primary
2024-11-01 13:35:52 Using pg_ctl to stop cluster at /u01/PG5432 on 5432...
2024-11-01 13:35:52 pg_ctl: waiting for server to shut down.... done
2024-11-01 13:35:52 pg_ctl: server stopped
2024-11-01 13:35:52 done
2024-11-01 13:35:52 done
2024-11-01 13:35:52 Switching primary and standby roles
2024-11-01 13:35:52 Primary database host is now centlin72.oraclekiwi.co.nz
2024-11-01 13:35:52 Standby database host is now centlin71.oraclekiwi.co.nz
2024-11-01 13:35:52 Waiting for Agents to respond to role switch
2024-11-01 13:35:52 Starting primary cluster
2024-11-01 13:35:52 Using pg_ctl to start cluster at /u01/PG5432 on 5432...
2024-11-01 13:35:52 pg_ctl: waiting for server to start....2024-11-01 13:35:52.258 NZDT [12118] LOG: redirecting log output to logging collector process
2024-11-01 13:35:52 pg_ctl: 2024-11-01 13:35:52.258 NZDT [12118] HINT: Future log output will appear in directory "log".
2024-11-01 13:35:52 pg_ctl: done
2024-11-01 13:35:52 pg_ctl: server started
2024-11-01 13:35:52 done
2024-11-01 13:35:52 Perform post-starting process in primary cluster
2024-11-01 13:35:52 Refreshed replication slot after primary cluster start up
2024-11-01 13:35:52 Starting standby cluster
2024-11-01 13:35:52 Using pg_ctl to start cluster at /u01/PG5432 on 5432...
2024-11-01 13:35:52 pg_ctl: waiting for server to start....2024-11-01 13:35:52.651 NZDT [5091] LOG: redirecting log output to logging collector process
2024-11-01 13:35:52 pg_ctl: 2024-11-01 13:35:52.651 NZDT [5091] HINT: Future log output will appear in directory "log".
2024-11-01 13:35:52 pg_ctl: done
2024-11-01 13:35:52 pg_ctl: server started
2024-11-01 13:35:52 done
2024-11-01 13:35:52 Validate primary cluster
2024-11-01 13:35:52 Force switching wal
2024-11-01 13:35:53 done
2024-11-01 13:35:53 Waiting for LSN 0/4B000250 to be replicated to new standby
2024-11-01 13:35:53 done
2024-11-01 13:35:53 Validate standby cluster
2024-11-01 13:35:53 done
2024-11-01 13:35:53 Applying Observer settings
2024-11-01 13:35:53 Enabling Observer
2024-11-01 13:35:53 done
2024-11-01 13:35:53
Task succeeded