【发布时间】:2021-01-08 16:56:24
【问题描述】:
我的 Cloud Function 无法连接到我的 Cloud SQL PostgreSQL 实例。我收到错误:
psycopg2.OperationalError: could not connect to server: Connection timed out
Is the server running on host "my.private.db.ip" and accepting
TCP/IP connections on port 5432?
有 2 个项目(A 和 B),通过 VPC Peering 连接。
- 项目 A - Cloud SQL PostgreSQL
- 项目 B - 云函数
使用这种架构有限制吗?
- 我正在尝试使用私有 IP 连接到我的数据库。
- 项目 B 上的其他 Cloud Functions 已成功连接到项目 A 上的 VM 实例。
注意:我正在尝试不使用公共 ip 进行此连接。
【问题讨论】:
标签: postgresql google-cloud-platform cloud