Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mongodb Can';t使用DNS种子列表连接格式连接,但使用标准连接字符串可以正常工作_Mongodb_Mongodb Compass - Fatal编程技术网

Mongodb Can';t使用DNS种子列表连接格式连接,但使用标准连接字符串可以正常工作

Mongodb Can';t使用DNS种子列表连接格式连接,但使用标准连接字符串可以正常工作,mongodb,mongodb-compass,Mongodb,Mongodb Compass,我试图连接到我的atlas群集,但它给了我超时错误。我尝试连接到本地mongodb,它可以工作,并且使用同一集群的标准连接字符串: (mongo "mongodb://cluster0-shard-00-00-n1kmr.mongodb.net:27017,cluster0-shard-00-01-n1kmr.mongodb.net:27017,cluster0-shard-00-02-n1kmr.mongodb.net:27017/test?replicaSet=Cluster0-shard-

我试图连接到我的atlas群集,但它给了我超时错误。我尝试连接到本地mongodb,它可以工作,并且使用同一集群的标准连接字符串:

(mongo "mongodb://cluster0-shard-00-00-n1kmr.mongodb.net:27017,cluster0-shard-00-01-n1kmr.mongodb.net:27017,cluster0-shard-00-02-n1kmr.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --ssl --authenticationDatabase admin  --username <username> --password <password>)
和db版本v4.2.6

>>mongo --version
MongoDB shell version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
allocator: tcmalloc
modules: none
build environment:
    distmod: 2012plus
    distarch: x86_64
    target_arch: x86_64
>> mongod --version
db version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
allocator: tcmalloc
modules: none
build environment:
    distmod: 2012plus
    distarch: x86_64
    target_arch: x86_64

你解决了吗?没有。我只是用了标准连接字符串。
>> mongod --version
db version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
allocator: tcmalloc
modules: none
build environment:
    distmod: 2012plus
    distarch: x86_64
    target_arch: x86_64