Cloud SQL

Task:-1 Edit SQL instance on GCP and suggest in which condition restart required. (5-5 example)

For this task first we need to create a SQL Instance. So lets create SQL Instance step by step as follows-

  1. Navigate to the Google Cloud Console.

    https://console.cloud.google.com

  2. Search database in search bar and click on SQL.

  3. Now, Click on Create Instance.

  4. Next choose Database Engine(MySQL, PostgreSQL, and SQL Server). Here we go for MySQL, click on Choose MySQL.

  5. Choose Cloud SQL edition (Enterprise plus, Enterprise), Preset(Production, Development, and Sandbox).

  6. Add Instance Info like Database version(8.0, 8.4), Instance I’d(Ex- test), Password.

  7. Choose Region and Zonal Availability( Single zone, Multiple zones for high availability).

  8. Add Machine Configuration and Storage.

  9. Next click on Create Instance.

    After 3-4 minutes SQL Instance should be up and running.

Now we have to check the conditions for which editing SQL Instance need a restart or serves without any restart.

Updates for which editing SQL Instance needs a RESTART.

  1. Changing Zonal availability from Multiple Zone to Single Zone.

    A popup window appears to indicate that a restart is required.

  2. Changing Location of Primary Zone from asia-east1-a to asia-east1-c.

    A popup window appears to indicate that a restart is required.

  3. Machine Configurations

    changing machine configuration from (2vCPU, 8GM RAM) to (4vCPU, 16 GB RAM).

    A popup window appears to indicate that a restart is required.

  4. Data Protection

    Enabling/ Disabling Automated daily backups and Point in time recovery needs a restart**.**

    A popup window appears to indicate that a restart is required.

  5. Flags

    Adding database flag requires a restart.

    A popup window appears to indicate that a restart is required.

Updates for which editing SQL Instance doesn’t needs a RESTART.

  1. Storage

    changing storage from 10 GB to 50 GB

  2. Query Insights

    Enabling Query insights doesn’t require restart.

  3. Lables

    Adding lables doesn’t needs a restart.

  4. Enable/Disable Deletion Protection

    Disabling deletion protection doesn’t require restart.

  5. Maintenance

    Adding maintenance window doesn’t require restart


Task:-2 Verify the Zonal Failover with an example

In the event of an instance or zone failure, the standby instance becomes the new primary instance. Users are then rerouted to the new primary instance. This process is called a failover.

In simple words, if primary instance crash then secondary( standby) instance acts like primary and in place of primary instance, secondary machine will create.

To enable failover in Google Cloud SQL, the instance must be set up in multiple zones. If the instance is created in a single zone, the failover option will not be available because failover requires multiple zones for High Availability.

Steps to trigger failover are as follows-

  1. Go to previously created MySQL instance.

  2. Click on Failover inside test MySQL Instance.

  3. Popup Window will appear to trigger failover. Write Instance I'd and click on Trigger Failover.

  4. In below image we can see that the location is changed from asia-east1-a to asia-east1-b.