Create Cloud SQL read replicas
Creating read replicas in Cloud SQL allows you to offload read-heavy workloads from your primary instance, improving performance and scalability. Here’s how you would theoretically create Cloud SQL read replicas:
-
Accessing Cloud SQL: Open the Google Cloud Console and navigate to the Cloud SQL page.
-
Select the Primary Instance: Choose the primary Cloud SQL instance from which you want to create a read replica.
-
Navigate to Replicas: Within the instance details page, locate the “Replicas” tab or section.
-
Click on “Create Replica”: Click on the “Create Replica” button to initiate the creation process.
-
Configure Replica Settings: Provide the necessary configuration details for the read replica, including:
- Replica name: Specify a unique name for the read replica.
- Region: Choose the region where you want to deploy the replica.
- Machine type: Select the machine type and storage capacity for the replica.
- Automatic backups: Choose whether to enable automatic backups for the replica.
Prerequisites
GCP account
Open Console.
Menu > SQL
the SQL instance
Click on Replicas.
Click on Create Read Replica.
Give the instance ID for replica.
Choose the region.
multiple zone will not be available. It is used for production instances.
Click on Show Configuration Options.
Choose the specification for the replica instance.
Choose public IP. If you want private IP you have to enable API and permissions.
Give any network
Click create replica.
It will take around 5 minute to create.
The replica will be created.
To disable replica open the replica and press Disable replication
Click Disable
To delete Replica, Press Delete.
Give the Replica ID and press delete. The Replica will be deleted
Create Cloud SQL read replicas