0

I know that there is many similar questions but I'm not able to find an answer to solve my issue.

I trying to connect Data Fusion to replicate a Cloud SQL for MySQL table. When trying to connect to the MySQL table I have the following error:

Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

From what I have gathered I need to:

  • Create the Data Fusion Private Instance by following this guide
  • Create the instance for Cloud SQL for MySQL with Private IP using the default network
  • Connecting the Cloud SQL instance from a VM instance following the Connect from a VM instance tutorial I found directly from the Connect to this instance section.

Everything is under the same project.

I'm trying my best here but I'm a bit lost. If someone can guide me through this.

Is there anything more I need to do here? What IP should I use when setting up the connection to MySQL in Data Fusion?

Simon Breton
  • 2,638
  • 7
  • 50
  • 105
  • Simon: Can you provide how you installed the cloudsql mysql driver in your cloud data fusion instance? To unblock is it possible to try out the same by connecting to a public cloudsql mysql instance for now? – Ajai Apr 22 '21 at 19:11

2 Answers2

2

If you want to connect Cloud Data Fusion with Cloud SQL for MySQL on Private IP you will need to deploy Cloud SQL Proxy. There is a lot of documentation around it. It seems to be the way to go.

Simon Breton
  • 2,638
  • 7
  • 50
  • 105
0

Assuming you are using Cloud Data Fusion to just get data from CloudSQL MySQL to GCP

There are a few existing questions/docs that have been discussed in the past

If you are indeed trying to use Cloud Data Fusion's Replication feature to replicate your db tables then connecting to a private CloudSQL MySQL instance is not supported yet. Here is the corresponding OSS JIRA to follow up if you are looking for this - https://cdap.atlassian.net/browse/CDAP-17938

Ajai
  • 3,440
  • 5
  • 28
  • 41
  • hum ok. This is frustrating. But when connecting on public IP the only way I found is to whitelist all IPs "0.0.0.0" . Any advice around this? – Simon Breton Apr 22 '21 at 23:12
  • Simon: Just to confirm are you still trying to use replication? Or just connecting CDF to a public cloudsql mysql? Can you share the steps you are doing for this (like a doc) where it mentions to whitelist all IPs? – Ajai Apr 22 '21 at 23:21
  • I want to use replication on a private cloudsql mysql. However out of curiosity I've created a dummy cloudsql mysql db and the connection with the replication is working when I'm whitelisting "0.0.0.0" – Simon Breton Apr 22 '21 at 23:47
  • Hhmm I don't see that as a step here - https://cloud.google.com/data-fusion/docs/tutorials/replicating-data/mysql-to-bigquery. Did you happen to check this documentation? – Ajai Apr 22 '21 at 23:56
  • This documentation is not for cloud sql mysql... or I'm missing something? – Simon Breton Apr 22 '21 at 23:59
  • Simon: My bad. Yes you are right. The whitelisting of 0.0.0.0 is needed for CDF & Dataproc VMs to be able to talk to CloudSQL MySQL instance. – Ajai Apr 23 '21 at 00:45
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/231530/discussion-between-simon-breton-and-ajai). – Simon Breton Apr 23 '21 at 18:18