如何为 Cloud Fusion 配置 JDBC 以连接安装在 localhost:3306 上的 MySQL

How to configure JDBC for Cloud Fusion to connect MySQL installed on localhost:3306

我正在尝试将我的本地独立 MySQL 与 Cloud Fusion 连接起来,以创建和测试数据管道。我已经成功部署了驱动程序。 此外,我已经使用 jdbc 字符串、用户名和密码的正确值配置了管道属性,但未建立连接。

连接字符串:jdbc:mysql://localhost:3306/test_database

我也尝试通过数据整理选项测试连接性,但也没有成功。

我是否需要通过设置一些 VPC 和隧道将两个环境置于同一网络下?

我认为您的问题更多地与如何将一些本地环境连接到 GCP 网络系统有关,该系统通过 VPC 连接模型收集 Google 云实例或资源。

承认 GCP 实际上在 Hybrid cloud concepts, I would encourage you to learn some fundamental principles of Cloud VPN as a essential part of performing secure connection between particular VPN Peer Gateway and Cloud VPN Gateway 中利用不同的连接方法这一事实,并进一步在各方之间创建 VPN 隧道。

我猜 GCP documentation about Data Fusion VPC peering 实现中甚至有专门的章节可能对您的用户案例有所帮助。

在您的示例中,我看到您在连接字符串中指定了 localhostlocalhost 仅通告到您计算机本地的其他服务 运行,而 Cloud Data Fusion(GCP 中的 运行)将无法访问 MySQL 实例(运行 在你的机器上)。因此,您会看到连接问题。

我强烈建议您查看此 answer on SO,这将帮助您快速设置概念验证。