【发布时间】:2021-01-10 18:22:14
【问题描述】:
我正在执行 mongoexport,然后执行 BigQuery 加载 5000 万条记录集合 我所有的云功能和应用程序引擎实例都通过 VPC 对等连接设置通过无服务器 VPC 很好地连接到 Mongo Atlas 访问我们在 GCP 中托管的 Atlas
但是,我无法让 Compute Engine 实例通过我们的 VPC 进行连接。当我添加 Compute Engine 实例外部 IP 时,它可以正常连接。当我删除它并添加 Compute Engine 实例的内部 IP 时,我得到了超时,但它确实显示:
2021-01-10T18:09:44.531+0000 could not connect to server: server selection error: server selection timeout, curr
ent topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: ***.mongodb.net:27017, Type: Unkn
own, State: Connected, Average RTT: 0, Last error: connection() : dial tcp *.*.*.*:27017: i/o timeout }, { Ad
dr: ***.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connec
tion() : dial tcp *.*.*.*:27017: i/o timeout }, { Addr: ***.mongodb.net:27017, Type: Unkn
own, State: Connected, Average RTT: 0, Last error: connection() : dial tcp *.*.*.*:27017: i/o timeout }, ] }
所以我最好的猜测是我没有输入正确的 IP 范围或正确的特定 IP 以允许计算引擎实例在内部连接,这似乎是 Mongo Atlas 防火墙阻止了。
在 VPC 上设置计算引擎和 mongo atlas 之间的连接的正确步骤是什么,以便没有入口/出口并且连接是直接的。
【问题讨论】:
标签: mongodb google-cloud-platform google-compute-engine google-vpc