连接mongodb失败. mongod 启动报错. [结贴]
service mongod start 以后就报下面的错误.
Starting mongod: Wed May 29 16:32:31.518
Wed May 29 16:32:31.518 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Wed May 29 16:32:31.518
about to fork child process, waiting until server is ready for connections.
forked process: 17684
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 100
[失败]
谁知道这是为什么呢?
找到原因了 google半天 发现说是没有正常关闭mongod服务,导致mongod被锁. 删除掉mongod里的mongod.lock 文件. 重新启动服务就行了.
6 回复
求 解救啊 ~~~~~
多谢啊~被困扰了许久,刚刚接触mongodb~
It’s my pleasure
自己写个脚本每次启动删除lock文件
mongod.lock在哪?没找到。
data/db 文件夹在系统根目录 mongo 没有权限访问,你需要 sudo mongod 执行,mongo 才有权限访问。