连接MongoDB时出现错误:SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>

问题详述:当输入mongo连接时自动退出,显示Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed

于是输入mongod,出现如上问题SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>

解决办法:再另外打开一个终端shell,打开对应bin目录,然后mongo就能连接了

原理:在运行了mongod命令之后,系统输出的日志会停在I SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>,

posted @ 2020-04-12 20:52  Celineay  阅读(1530)  评论(0编辑  收藏  举报