Google Cloud SQL

SQL Automatic Failover To Another Zone Missing

Ensures that all database instances have a DB replica enabled in a secondary AZ

Risk Level: Low

Description

This plugin guarantees that the SQL instances are configured for high availability (regional). This assures that in the event of an outage, the instance will fail over to a zone where there is no outage. If this option is deactivated, the instance will only be located in one zone, resulting in a single point of failure. As a result, PingSafe strongly advises enabling this functionality.

About the Service

Google Cloud SQL:

Google Cloud SQL is a relational database for MySQL, PostgreSQL, and SQL Server that is fully managed. It automates database provisioning, storage capacity management, replication, and backups while lowering maintenance costs. It can be set up easily using the built-in migration tools and lets you scale your instances effortlessly. To know more about Cloud SQL, read here

Impact

If your instance does not have the high availability configuration enabled, then there will be no failover in case of a zonal outage or if the instance becomes corrupted. As a result, in the event of such an occurrence, your instance will be unavailable.

Steps to Reproduce

Using GCP Console-

  1. Log In to your GCP Console.
  2. From the top navigation bar, select the GCP project you want to investigate.
  3. From the navigation panel on the left side of the console, go to SQL. You can use this link here to navigate directly if you’re already logged in.
  4. Select the Instance ID of the SQL instance you want to investigate from the list of instances available and click on the OVERVIEW tab to check the configuration settings.

  5. Under the Configuration section, check the high availability configuration status. If it says Not highly available, then the selected SQL instance does not have automatic failover enabled.
  6. Repeat steps 4 and 5 for all the SQL instances you want to investigate in the selected project.
  7. If you have multiple projects, repeat steps 2 to 6 for each project in your GCP Console. 

Steps for Remediation

Follow the steps to make the necessary changes to create a failover replica for high availability.


Using GCP Console-

  1. Log In to your GCP Console.
  2. From the top navigation bar, select the GCP project you want to investigate.
  3. From the navigation panel on the left side of the console, go to SQL. You can use this link here to navigate directly if you’re already logged in.
  4. Select the Instance ID of the SQL instance you want to reconfigure in the list of instances available and click on the OVERVIEW tab. (In case you aren’t sure which SQL instance needs to be configured, follow the steps to reproduce listed above to determine which to choose.)

  5. Click on the EDIT button found on the top navigation bar.
  6. Under Choose region and zonal availability section, select Multiple zones (highly available) for the Zonal availability configuration. You can click on SPECIFY ZONES and choose your desired Primary and Secondary zones.
  7. Click on the SAVE button and click on SAVE AND RESTART in the Changes require restart popup box to confirm the changes and restart the instance.
  8. Repeat steps 4 to 7 for all the SQL instances you want to reconfigure in the selected project.
  9. If you have multiple projects, repeat steps 2 to 8 for each project in your GCP console.