Legacy configuration for high availability Stay organized with collections Save and categorize content based on your preferences.
Important: As of January 13, 2025, thelegacy configuration for high availability (HA) is deprecated for all instances.You can't create instances with legacy high availability configuration, and you can'tenable legacy high availability configuration on any existing instances.In addition, after January 13, 2025, legacy high availability instancesare no longer covered by theCloud SQL SLA.
We recommend that youupdate your remaining legacy high availability instances to the current high availability configuration.You can do so by following the instructions inUpdate an instance from legacy to current high availability.Starting on May 1, 2025, Cloud SQL will begin updating anyinstances that use the legacy high availability configuration to use the current regionalpersistent disk-based high availability configuration automatically.
This page describes the legacy configuration for a MySQL instance for high availability (HA).
In a legacy HA configuration,a Cloud SQL for MySQL instance uses a failover replica to add high availability to the instance.This feature isn't available in Google Cloud console. The recommended configuration doesn't usefailover replicas. Instead, the current high availability configuration uses Googleregional persistent disks, which synchronouslyreplicate data at the block-level between two zones in a region.
For more information about the current high availability configuration, seeOverview of the High Availability Configuration.
Update an instance from legacy to current high availability
To update your instance from the legacy to the current high availabilityconfiguration, do the following:
Update your instance to the current high availability configuration.
- Delete the failover replica for the MySQL instance you want to update. For more information, seeDisable high availability on an instance.
- Configure the primary instance to use the current version of high availability. For more information, seeConfigure an existing instance for high availability.
As another option, use Database Migration Service tomigrate to an instancethat uses the current high availability configuration.
Create a read replica instance to offload any read workloads that you don't want to perform on the primary instance.
Initiate failover
Testing failover is optional, but is recommended so that you can see how yourapplication responds in the event of a failover.
Note: This feature helps you test your application's response to an automaticfailover. Make sure your instance has completed any previous failover (so it isresponding to connection requests) before you trigger another failover.To learn more about failovers, see theFailover overview.
gcloud
Initiate the failover:
gcloudsqlinstancesfailoverPRIMARY_INSTANCE_NAME
curl
- Describe the primary instance to get the value of the
settingsVersionfield.gcloudauthloginACCESS_TOKEN="$(gcloudauthprint-access-token)"curl--header"Authorization: Bearer${ACCESS_TOKEN}"\-XGET\https://www.googleapis.com/sql/v1beta4/projects/PROJECT-ID/instances/PRIMARY_INSTANCE_NAME
- Initiate the failover:
gcloudauthloginACCESS_TOKEN="$(gcloudauthprint-access-token)"curl--header"Authorization: Bearer${ACCESS_TOKEN}"\--header'Content-Type: application/json'\--data'{"failoverContext":{"settingsVersion":"SETTINGS_VERSION"}}'\-XPOST\https://www.googleapis.com/sql/v1beta4/projects/PROJECT-ID/instances/PRIMARY_INSTANCE_NAME/failover
The instance fails over and is not available to serve data for a few minutes.
Legacy configuration: Create an alert for replication lag
The time required for a failover operation depends on the amount of replicationlag when the failover is initiated. You can use Cloud Monitoring in theGoogle Cloud console to alert you when replication lag exceeds a threshold.
Note: Failover downtime caused by replication lag greater than 1200 seconds isnot counted against the SLA for the instance.For more information about replication lag, search for "seconds_behind_master"on theSHOW SLAVE STATUS Syntax page in the MySQL documentation.
For more information about Cloud Monitoring, seethe Cloud Monitoring documentation.
Note: A newly created Cloud SQL instance can take time to appear inthe Cloud Monitoring interface. If you don't see a new instance, thencheck again in an hour.Legacy configuration: Set an alert for a specific failover replica
- In the navigation panel of the Google Cloud console,selectMonitoring, and then selectAlerting.
- ClickCreate Alerting Policy.
- Enter a descriptive name for your alert.
- SelectMetric Threshold and clickNext to open the Target tab.
- ForResource Type, selectCloud SQL.
- ForApplies To, selectSingle, then select your failover replica.
- ClickNext to open the Configuration tab.
Enter the following values:
Field Value If Metric Seconds Behind Master Condition above Thresholds 120 (or whatever value is appropriate for your environment) For 3 minutes Select yourNotification methods, and clickSave Condition.
Legacy configuration: Set an alert for a group of failover replicas
If you plan to create multiple failover replicas in the same project, it couldbe easier to set the alert for the entire group, rather than on each failoverreplica individually. To create a group for monitoring, use a suffix for thefailover replicas' names, such as "-failover". Make sure you don't use thissuffix for any other types of Cloud SQL instances.
Create your failover replica group:
In the Google Cloud console, go to theMonitoring page.
- From the upper menu bar, selectGroups >Create....
- Enter a descriptive name for your group.
- LeaveName andContains selected, and enter your name substring.
- ClickSave Group. The summary page for the new group opens.
- Confirm that the expected instances are included in the group.
Create the alert for the failover replica group:
- In the navigation panel of the Google Cloud console,selectMonitoring, and then selectAlerting.
- ClickCreate Alerting Policy.
- Enter a descriptive name for your group alert.
- SelectMetric Threshold and clickNext to open the Target tab.
- ForResource Type, selectCloud SQL.
- ForApplies To, selectGroup, then select your failover group.
- LeaveAny Member Violates selected and clickNext to open theConfiguration tab.
Enter the following values:
Field Value If Metric Seconds Behind Master Condition above Thresholds 120 (or whatever value is appropriate for your environment) For 3 minutes Select your desiredNotification methods, and clickSave Condition.
Legacy configuration: Disable high availability on an instance
You need to delete the failover replica instance to remove high availability from theprimary instance.
Before you perform this procedure, make sure there are no operations currentlyrunning on the primary instance.
To disable high availability:
Console
In the Google Cloud console, go to theCloud SQL Instances page.
- Select the failover instance associated with the instance you want to disable high availability on.
- On theInstance details page, clickDelete.
- In theDelete Replica window, retype the name of failover instance.
- ClickDelete. The configuration for the original instance changes to zonal.
gcloud
For reference information, seegcloud sql instances delete.gcloudsqlinstancesdeleteFAILOVER_REPLICA_NAME
curl
The following request uses theinstances:delete method to delete the instance.gcloudauthloginACCESS_TOKEN="$(gcloudauthprint-access-token)"curl--header"Authorization: Bearer${ACCESS_TOKEN}"\--header'Content-Type: application/json'\-XDELETE\https://www.googleapis.com/sql/v1beta4/projects/PROJECT-ID/instances/INSTANCE_NAME
What's next
- Learn more abouthow the high availability configuration works.
- Test how your application responds to lost connections byrestarting your instance.
- Learn more aboutmanaging your database connections.
- Learn more aboutCloud Monitoring.
- Create read replicas for your instance.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.