You can use a repmgr command to switch the roles of the primary and one of the standby nodes in your database high availability cluster during a planned maintenance.

Prerequisites

  • Put all vCloud Director cells that are part of the high availability cluster into maintenance mode.
  • Verify that all the nodes in the cluster are healthy and online.

Procedure

  1. Log in or SSH as root to the OS of the standby node that you want to promote.
  2. Change the user to postgres.
    sudo -i -u postgres
  3. (Optional) Verify that the prerequisites for the switchover are met by running the command with the --dry-run option.
    /opt/vmware/vpostgres/current/bin/repmgr standby switchover -f /opt/vmware/vpostgres/current/etc/repmgr.conf --siblings-follow --dry-run
  4. Switch the roles of the primary and the standby cell.
    /opt/vmware/vpostgres/current/bin/repmgr standby switchover -f /opt/vmware/vpostgres/current/etc/repmgr.conf --siblings-follow

Results

The last line of the console output indicates that the standby switchover has completed successfully.

What to do next

  1. Run the reconfigure-database command to update the database IP address on all vCloud Director cells. See Update the Database IP Addresses on vCloud Director Cells.
  2. When you reconfigure the vCloud Director cells in the server group to point to the new primary database, take out of maintenance mode all vCloud Director cells that are part of the high availability cluster.