High availability on secondary clusters

This page describes support of high availability (HA) on an AlloyDB for PostgreSQL secondary instance and steps to fail over a secondary cluster manually.

For disaster recovery and to reduce downtime when a secondary instance becomes unavailable, AlloyDB offers HA on secondary instances.

By default, HA is configured on a secondary instance.

An AlloyDB secondary instance comprises two nodes: an active secondary node, which responds to requests, and a standby secondary node. The active and standby nodes are located in two different zones in a region. If AlloyDB detects unavailability of the active node, it fails over to the standby node to act as the new active node. Your data is then rerouted to the new active node. This process is called a failover.

Fail over a secondary instance manually

Failing over a secondary instance manually is similar to the steps followed for failing over the primary instance manually.

To fail over a secondary cluster manually, follow these steps:

Console

  1. In the Google Cloud console, go to the Clusters page.

    Go to Clusters

  2. Click the name of a secondary cluster in the Resource Name column.

  3. On the Overview page, go to the Instances in your cluster section, choose the secondary instance, and click Failover.

  4. In the dialog that appears, enter the instance's ID, and click Trigger failover.

gcloud

To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.

Use the gcloud alloydb instances failover command to force a secondary instance to fail over its standby.

 gcloud alloydb instances failover SECONDARY_INSTANCE_ID \
 --cluster=SECONDARY_CLUSTER_ID \
 --region=REGION_ID \
 --project=PROJECT_ID

Replace the following:

  • SECONDARY_INSTANCE_ID: The ID of the secondary instance that you want to fail over.
  • SECONDARY_CLUSTER_ID: The ID of the secondary cluster that the secondary instance is associated with.
  • REGION_ID: The ID of the secondary instance's region—for example, us-central1.
  • PROJECT_ID: The ID of the secondary cluster's project.

What's next