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-
Navigate to the Google Cloud Console.
Search database in search bar and click on SQL.
Now, Click on Create Instance.
Next choose Database Engine(MySQL, PostgreSQL, and SQL Server). Here we go for MySQL, click on Choose MySQL.
Choose Cloud SQL edition (Enterprise plus, Enterprise), Preset(Production, Development, and Sandbox).
Add Instance Info like Database version(8.0, 8.4), Instance I’d(Ex- test), Password.
Choose Region and Zonal Availability( Single zone, Multiple zones for high availability).
Add Machine Configuration and Storage.
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.
Changing Zonal availability from Multiple Zone to Single Zone.
A popup window appears to indicate that a restart is required.
Changing Location of Primary Zone from asia-east1-a to asia-east1-c.
A popup window appears to indicate that a restart is required.
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.
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.
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.
Storage
changing storage from 10 GB to 50 GB
Query Insights
Enabling Query insights doesn’t require restart.
Lables
Adding lables doesn’t needs a restart.
Enable/Disable Deletion Protection
Disabling deletion protection doesn’t require restart.
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-
Go to previously created MySQL instance.
Click on Failover inside test MySQL Instance.
Popup Window will appear to trigger failover. Write Instance I'd and click on Trigger Failover.
In below image we can see that the location is changed from asia-east1-a to asia-east1-b.