mongoDB登陆失败,报
2017-08-17T16:24:04.385+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2017-08-17T16:24:04.385+0800 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
这样的错误,然后对其进行修复,和重启(mongo的路径自行修改):
cd /usr/local/mongodb/bin
./mongod --repair
mongod -f ../etc/mongodb.conf
报了这样的错误:
about to fork child process, waiting until server is ready for connections.
forked process: 20539
ERROR: child process failed, exited with error number 1
解决方法:
删掉lock,再重启(路径因人而异,不过都是在mongo的存储路径(即db)下的):
rm /data/mongo/db/mongod.lock
再对其进行重启:
mongod -f ../etc/mongodb.conf
就OK了