简体   繁体   English

我无法理解 Pymongo 中的这个错误

[英]I cannot understand this error in Pymongo

I am working on a project and I need well... a Database (MongoDB atlas) and I see while trying to send data I get this error:我正在做一个项目,我需要很好......一个数据库(MongoDB atlas),我在尝试发送数据时看到我收到此错误:

    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: cluster0-shard-00-00.e4dtu.mongodb.net:27017: connection closed,cluster0-shard-00-01.e4dtu.mongodb.net:27017: connection closed,cluster0-shard-00-02.e4dtu.mongodb.net:27017: connection closed, Timeout: 30s, Topology Description: <TopologyDescription id: 61fa067baedd893a84a4269d, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('cluster0-shard-00-00.e4dtu.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-00.e4dtu.mongodb.net:27017: connection closed')>, <ServerDescription ('cluster0-shard-00-01.e4dtu.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-01.e4dtu.mongodb.net:27017: connection closed')>, <ServerDescription ('cluster0-shard-00-02.e4dtu.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-02.e4dtu.mongodb.net:27017: connection closed')>]>

Well I was being an Idiot and running the code on Replit... Which ofc runs on a different computer whose IP address was not SET tp my Database.好吧,我是个白痴,并在 Replit 上运行代码...哪个 ofc 在另一台计算机上运行,其 IP 地址未在我的数据库中设置。 I now run it on my local computer and it is fine.我现在在我的本地计算机上运行它,它很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM