gpt4 book ai didi

mongodb - 连接到主机时出错 : could not connect to server: server selection error: server selection timeout current topology: Type: Single Servers

转载 作者:行者123 更新时间:2023-12-04 01:36:15 28 4
gpt4 key购买 nike

我需要将一个 CSV 文件导入到 mongoDB 不幸的是我遇到了以下错误:

    error connecting to host: could not connect to server: server selection error: server selection timeout
current topology: Type: Single
Servers:
Addr: eaderline:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : dial tcp: lookup eaderline: no such host

我的导入字符串如下所示:
mongoimport --host Test-shard-0/test-shard-00-00-gceee.mongodb.net:27017,test-shard-00-01-gceee.mongodb.net:27017,test-shard-00-02-gceee.mongodb.net:27017 --ssl --username <username> --password <password> --authenticationDatabase admin --db EngineeringProject --collection FirstName --type csv -file "C:\Users\Ja\Desktop\INFA\ProjektInzynierski\DaneDBzMC\imiona.csv" -headerline

关于这个错误的有趣部分是,我能够在 2 周前通过类似的字符串将数据导入到 mongodb,看起来像下面这个,今天这是不可能的,为什么?
mongoimport --host Test-shard-0/test-shard-00-00-gceee.mongodb.net:27017,test-shard-00-01-gceee.mongodb.net:27017,test-shard-00-02-gceee.mongodb.net:27017 --ssl --username <username> --password <password> --authenticationDatabase admin --db Test2 --collection COL_First --type csv -file "C:\Users\Ja\Desktop\Przykladowy\Mapy\liczba.csv" -headerline

有没有人看到任何错误?

我已经检查了我机器上的端口 27017 是否空闲,也许集群端发生了什么?
有没有办法启动一个空的导入,只是为了检查连接?

最佳答案

最后,我能够通过 mongodb GUI 客户端 Compass 导入我的 CSV 文件。

与此同时,我遇到了另一个问题。 Compass connect 集群显示数据库,但没有显示集合。结果发现我的用户角色不好。我删除了用户并再次添加它,它起作用了,我也可以看到集合。

之后,我能够导入我的 CSV 文件。

关于mongodb - 连接到主机时出错 : could not connect to server: server selection error: server selection timeout current topology: Type: Single Servers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59413297/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com