Question

Difficulty: MediumDeploying and Configuring Managed Database Instances

A cloud engineer needs to deploy a primary Cloud SQL for MySQL database instance with private IP connectivity in a custom VPC network, enable binary logging, and provision a cross-region read replica in a secondary region. Arrange the steps in the correct operational sequence to complete this deployment.

  1. 1Allocate an internal IP address range for Google Services in the custom VPC network using the gcloud compute addresses create command.
  2. 2Establish a private connection between the custom VPC network and Google Services using the gcloud services vpc-peerings connect command.
  3. 3Deploy the primary Cloud SQL instance using gcloud sql instances create with --network, --no-assign-ip, and --enable-bin-log flags.
  4. 4Provision the read replica in the secondary region using gcloud sql instances create with the --master-instance-name flag.

Answer

The correct sequence is: 1) Reserve an internal IP address range for private services in the custom VPC network, 2) Establish a VPC peering connection to Google Services, 3) Create the primary Cloud SQL instance with private IP and binary logging enabled, and 4) Provision the cross-region read replica referencing the primary instance.
The correct deployment sequence starts by allocating an internal IP range in the custom VPC network for Google Services, followed by establishing VPC peering via Service Networking. Next, the primary Cloud SQL instance is created with private IP (--no-assign-ip and --network) and binary logging enabled (--enable-bin-log). Finally, the cross-region read replica is created by specifying the primary instance as its master.

Step-by-Step Solution

1
Allocate a named IP range in the custom VPC network using gcloud compute addresses create.
An IP block is allocated for Service Networking inside the VPC.
Private Service Access requires a dedicated internal IP address block allocated prior to establishing the peering connection.
2
Create the private connection using gcloud services vpc-peerings connect.
VPC peering is established between the custom VPC and the Google Service Producer network.
Cloud SQL private instances communicate with the VPC via this VPC peering connection.
3
Deploy the primary Cloud SQL MySQL instance using gcloud sql instances create with --network, --no-assign-ip, and --enable-bin-log.
The primary Cloud SQL instance is provisioned with private IP in the primary region.
Binary logging on the master instance is mandatory to enable point-in-time recovery and replication to read replicas.
4
Create the read replica using gcloud sql instances create specifying --master-instance-name and the target secondary --region.
The read replica is provisioned in the secondary region and begins replicating data from the primary instance.
Replicas require an existing active primary database instance that supports replication.

Key Concept

Deploying Cloud SQL Instances with Private IP and Cross-Region Read Replicas
Rate this question