MongoDB:Mongo Tools的Atlas连接问题

时间:2020-10-15 14:28:05

标签: mongodb ubuntu-18.04 mongodb-atlas

嘿,我正在学习如何通过shell命令使用Mongodb Atlas。

我可以通过Mongo Shell成功连接到我的Atlas集群。不幸的是,我无法使用Mongo Tools(mongoimport,mongoexport,mongostat)做到这一点。

如果我执行此命令:

i ==  0, (1.0e00)            1.00 + 1.0 ==            2.00
i ==  1, (1.0e01)           10.00 + 1.0 ==           11.00
i ==  2, (1.0e02)          100.00 + 1.0 ==          101.00
i ==  3, (1.0e03)         1000.00 + 1.0 ==         1001.00
i ==  4, (1.0e04)        10000.00 + 1.0 ==        10001.00
i ==  5, (1.0e05)       100000.00 + 1.0 ==       100001.00
i ==  6, (1.0e06)      1000000.00 + 1.0 ==      1000001.00
i ==  7, (1.0e07)     10000000.00 + 1.0 ==     10000001.00
i ==  8, (1.0e08)    100000000.00 + 1.0 ==    100000000.00
i ==  9, (1.0e09)   1000000000.00 + 1.0 ==   1000000000.00
i == 10, (1.0e10)  10000000000.00 + 1.0 ==  10000000000.00

我收到:

+ 1.0

其他命令也会重复出现相同的问题。我不知道这是否重要,但是我在uni网络上使用Ubuntu 18.04。

我尝试搜索任何解决方案,但找不到任何有用的方法。按照建议here更改resolv.conf并没有实现任何事情,只是切断了我的网络连接:P

有人知道吗?

1 个答案:

答案 0 :(得分:0)

好吧,这是比实际答案更多的解决方法,但是我的解决方案是不使用Atlas网站提供的命令行工具,也不使用srv连接。

mongostat --host "sandbox-shard-####.gcp.mongodb.net:27017,
sandbox-shard-####.gcp.mongodb.net:27017,
sandbox-shard-#####.gcp.mongodb.net:27017" 
--authenticationDatabase admin --ssl --username ##### --password #####

为我工作。