can't connect Cloud Data Fusion with Cloud SQL for MySQL with Private IP

967 Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

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.

7
On

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