ubuntu mongo error : couldn't connect to server 127.0.0.1:27017 解决

problem appear:

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

Workaround:
1 Delete the .lock file,

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

2 repair mongodb

mongod -repair

3 Start the mongo service.

sudo service mongodb start

After entering mongodb
, if there is still an error, you can consider clearing the disk space.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324909282&siteId=291194637