我的mongo shell正在启动时没有任何错误
>use mydb
也正常工作(此处db名称为mydb)
但是当我给show collections命令时,它显示以下错误。
>show collections
Wed Oct 15 17:38:30 uncaught exception: error: {
"$err" : "file /var/lib/mongodb/mydb.6 open/create failed in createPrivateMap (look in log for more information)",
"code" : 13636
}
这是错误日志
17:38:22 [initandlisten] connection accepted from 127.0.0.1:53178 #1
17:38:30 [conn1] ERROR: mmap private failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64
17:38:30 [conn1] Assertion: 13636:file /var/lib/mongodb/mydb.6 open/create failed in createPrivateMap (look in log for more information)
17:38:30 [conn1] assertion 13636 file /var/lib/mongodb/mydb.6 open/create failed in createPrivateMap (look in log for more information) ns:mydb.system.namespaces query:{}
17:39:01 [clientcursormon] mem (MB) res:2 virt:90 mapped:0
基于针对另一个stackoverflow问题couldn't connect to server 127.0.0.1 shell/mongo.js给出的一个解决方案,我在我的情况下尝试了相同的步骤并且问题暂时解决了,但主要问题是每当我关闭我的机器并重新启动时我得到了同样的错误,我必须重复相同的步骤(如上面的链接所示),使mongo shell工作,最终导致集合中的数据丢失。任何人都可以建议可能是什么原因,我的mongodb安装有问题吗?如果有人遇到类似问题并成功解决,请告诉我。感谢
答案 0 :(得分:1)
我认为问题有两个可能的来源: