Part 3 – Switch Standby vCD Node to Primary

Loading

Blog Series

As shown in our previous blog, we have 3 vCD appliances in HA mode. One acts as the primary and the second/third acts as a Standby mode. In this blog, we are going to test the HA we implemented in the previous blog.

The vCloud Director appliance includes an embedded PostgreSQL database. The embedded PostgreSQL database includes the Replication Manager (repmgr) tool suite, which provides high availability (HA) function to a cluster of PostgreSQL servers.

After the initial standby appliance deployment, the replication manager begins synchronizing its database with the primary appliance database.

Launch a web browser and connect to the VCD management address via https://vcdip:5480 with root/password

Manual and Automatic VMware Cloud Director Appliance Failover

This image has an empty alt attribute; its file name is image-410.png

Switching Standby vCD Cell to Primary from UI

Log in as root to the appliance management user interface of a running standby cell.

Click the Standby Node that needs to be promoted as primary and Click Promote

Confirm to proceed

The cell becomes the new primary cell in a running state. The other standby cell is following the newly promoted primary cell.

Switching Standby vCD Cell to Primary from PostGres DB

It’s also possible we can use the command repmgr to switch roles for our vCD Cells in HA mode during a planned window

We will need to establish an SSH connection to the standby node that needs to be promoted as primary.

Change the user to postgres

#sudo -i -u postgres

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

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

Verify the stats via the UI

We can use the below command to see the database server details on other nodes, it should be automatically updated to the primary node.

#grep "database.jdbcUrl" /opt/vmware/vcloud-director/etc/global.properties

If any of the cells is not updated, run the command to reconfigure it

Initially stop the cell service on a specific node

#service vmware-vcd stop

Use the below command to update the database node details and start the services

#/opt/vmware/vcloud-director/bin/cell-management-tool reconfigure-database --database-host primary node IP address
#service vmware-vcd start

(Visited 967 times, 1 visits today)

By Ash Thomas

Ash Thomas is a seasoned IT professional with extensive experience as a technical expert, complemented by a keen interest in blockchain technology.

Leave a Reply