Hello,
Previously, I successfully conducted a POC using DataStream to replicate data from MySQL to BigQuery (BQ) using Cloud Auth Proxy. In my POC project, I utilized Terraform to create all necessary resources, including the MySQL instance, VPC, DataStream connection profile, DataStream private connection, Cloud Auth Proxy, and other required components. This setup worked well, allowing me to establish a connection profile for DataStream successfully.
However, in a subsequent attempt to replicate this approach using an existing VPC network and SQL instance, I encountered same issue . Although I integrated the required parts using Terraform and ensured that the Cloud Auth Proxy successfully connects to the MySQL database, I consistently face an issue during the creation of the DataStream source connection profile. The error repeatedly indicates that the MySQL server is unable to establish a connection. I don't able to understand why it is like this?
If you have any insights or suggestions on resolving this connectivity issue, I would greatly appreciate your guidance.
Solved! Go to Solution.
Given the connectivity issue you're encountering with DataStream while attempting to create the source connection profile, here are several troubleshooting steps and considerations to help resolve the problem:
1. Verify Network Configuration
mysql -u <your_user> -p -h 127.0.0.1 --port <proxy_port>
Example (Terraform):
Here's a snippet to ensure your VPC peering and firewall rules are set up correctly in Terraform:
resource "google_compute_network_peering" "datastream_peering" {
name = "datastream-to-my-vpc-peering"
network = "my-existing-vpc" # Replace with your VPC name
peer_network = "datastream-vpc-network"
}
resource "google_compute_firewall" "allow_mysql" {
name = "allow-mysql-traffic"
network = "my-existing-vpc"
allow {
protocol = "tcp"
ports = ["3306"]
}
source_ranges = ["<datastream-vpc-cidr-range>"] # Replace with actual range
}
Given the connectivity issue you're encountering with DataStream while attempting to create the source connection profile, here are several troubleshooting steps and considerations to help resolve the problem:
1. Verify Network Configuration
mysql -u <your_user> -p -h 127.0.0.1 --port <proxy_port>
Example (Terraform):
Here's a snippet to ensure your VPC peering and firewall rules are set up correctly in Terraform:
resource "google_compute_network_peering" "datastream_peering" {
name = "datastream-to-my-vpc-peering"
network = "my-existing-vpc" # Replace with your VPC name
peer_network = "datastream-vpc-network"
}
resource "google_compute_firewall" "allow_mysql" {
name = "allow-mysql-traffic"
network = "my-existing-vpc"
allow {
protocol = "tcp"
ports = ["3306"]
}
source_ranges = ["<datastream-vpc-cidr-range>"] # Replace with actual range
}