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.