node.js – 无法连接到127.0.0.1:27017,原因:errno:111连接被拒绝

而在ubuntu尝试这个mongo命令
我得到这个错误。

    ritzysystem@ritzysystem-Satellite-L55-A:~$ mongo
    MongoDB shell version: 2.6.1
    connecting to: test
    2014-10-06T12:59:35.802+0530 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
    2014-10-06T12:59:35.802+0530 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
    exception: connect failed

我怎么能纠正这是任何人都有同样的问题。

运行以下命令:

sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart

Connection refused to MongoDB errno 111

http://stackoverflow.com/questions/26211671/failed-to-connect-to-127-0-0-127017-reason-errno111-connection-refused

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:node.js – 无法连接到127.0.0.1:27017,原因:errno:111连接被拒绝