Mongodb 未检测到集合[Mongo shell]的主节点
我目前的MongoDb版本是3.2.7 我正试图用这个连接到我的数据库Mongodb 未检测到集合[Mongo shell]的主节点,mongodb,shell,mongo-shell,Mongodb,Shell,Mongo Shell,我目前的MongoDb版本是3.2.7 我正试图用这个连接到我的数据库 "mongo mongodb://meanbeta-shard-00-00-sshqm.mongodb.net:27017,meanbeta-shard-00-01-sshqm.mongodb.net:27017,meanbeta-shard-00-02-sshqm.mongodb.net:27017/test?replicaSet=MEANbeta-shard-0" --authenticationDatabase adm
"mongo mongodb://meanbeta-shard-00-00-sshqm.mongodb.net:27017,meanbeta-shard-00-01-sshqm.mongodb.net:27017,meanbeta-shard-00-02-sshqm.mongodb.net:27017/test?replicaSet=MEANbeta-shard-0" --authenticationDatabase admin --ssl --username xxxx --password xxxxx
昨天我可以通过mongo shell连接,但今天它给了我错误,但我仍然可以使用Compass应用程序连接:
2017-10-20T20:34:04.682+0530 I NETWORK [thread1] Starting new replica set monitor for MEANbeta-shard-0/meanbeta-shard-00-00-sshqm.mongodb.net:27017,meanbeta-shard-00-01-sshqm.mongodb.net:27017,meanbeta-shard-00-02-sshqm.mongodb.net:27017
2017-10-20T20:34:04.682+0530 I NETWORK [ReplicaSetMonitorWatcher] starting
2017-10-20T20:34:07.708+0530 W NETWORK [thread1] No primary detected for set MEANbeta-shard-0
2017-10-20T20:34:11.095+0530 W NETWORK [thread1] No primary detected for set MEANbeta-shard-0
2017-10-20T20:34:14.516+0530 W NETWORK [thread1] No primary detected for set MEANbeta-shard-0
2017-10-20T20:34:16.637+0530 W NETWORK [ReplicaSetMonitorWatcher] No primary detected for set MEANbeta-shard-0
2017-10-20T20:34:20.056+0530 W NETWORK [thread1] No primary detected for set MEANbeta-shard-0
2017-10-20T20:34:20.056+0530 E QUERY [thread1] Error: connect failed to replica set MEANbeta-shard-0/meanbeta-shard-00-00-sshqm.mongodb.net:27017,meanbeta-shard-00-01-sshqm.mongodb.net:27017,meanbeta-shard-00-02-sshqm.mongodb.net:27017 :
我是MongoDB及其副本集概念的新手,请帮我解决这个问题
谢谢不要从apt get安装mongo shell,因为它安装的是旧版本。您需要MongoDB shell版本3.4.10或更高版本,它才能工作 在通过mongo网站上的“从shell连接到群集”对话框中显示的链接安装新版本之前,我也遇到了同样的问题 谢谢@Natesh
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.8/main' >> /etc/apk/repositories && \
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.8/community' >> /etc/apk/repositories && \
apk update && \
apk add mongodb=3.6.7-r0 && \
mongo --version
对我有用。在更新Mongo Shell之后,它突然起作用了是的,它对我有用。不要使用apt命令行安装。3.4.10对我不起作用,但3.6.21对我起作用