防止生产环境中的mongoDB shell错误

时间:2013-10-30 14:49:24

标签: php mongodb ubuntu

如何从mongoDB shell或当我尝试从php

连接到它时防止这些错误
Message: Failed to connect to: localhost:27017: Remote server has closed the connection 

JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112 exception: connect failed

couldn't connect to server 127.0.0.1 shell/mongo.js

每当出现这些错误中的一个时,我每次都必须运行此命令

sudo rm /var/lib/mongodb/mongod.lock   
sudo -u mongodb mongod -f /etc/mongodb.conf --repair 
sudo service mongodb start

如何在我的生产环境中永远防止和解决这些错误。

由于

0 个答案:

没有答案