Php 在我的生产环境中防止mongoDB shell错误
如何从mongoDB shell或当我尝试从php连接到它时防止这些错误Php 在我的生产环境中防止mongoDB shell错误,php,mongodb,ubuntu,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:
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
如何在我的生产环境中永远防止和解决这些错误
谢谢你为什么要将MongoShell连接到php???我连接到mongoDB不是使用php连接到shell,而是使用shell进行一些查询看起来mongoDB的服务可能会崩溃?你看过任何日志了吗?