过去几天的阅读,我的错误日志已经充满了这样的错误:PHP蒙戈错误从插座
send_package: error reading from socket: The socket is closed
我真的不知道这是哪里来的。看起来我的MongoDB服务器没有打开TCP套接字,但我真的只是在猜测。
有没有人看过这个错误或知道如何处理它?
线产生的错误是:
$mongo = new Mongo("mongodb://user:[email protected]/db",array('timeout'=>6000));
我也偶尔疙瘩DIC中获得的:
class HurstDI extends \Pimple
{
public function __construct(){
$this['mongoUser'] = 'user';
$this['mongoPwd'] = 'pwd';
$this['mongoHost'] = "host/db";
$this['mongoTimeout'] = 6000;
$this['mongodb'] = function($c){
return new \MongoClient("mongodb://{$c['mongoUser']}:{$c['mongoPwd']}@{$c['mongoHost']}");
};
}
}
什么是从MongoDB的话说,日志?它会不时重新启动吗? – hek2mgl
嗯,我看过日志,但是我猜想我没有回到足够远的地步。我看到很多'code'Wan Jan 9 18:18:11 [initandlisten]从10.158.26.40:52664#17298接收的连接 Wed Jan 9 18:18:11 [initandlisten]连接被拒绝,因为打开的连接太多:819 Wed Jan 9 18:18:11 [initandlisten]从10.29.133.149:56104接受的连接#17299 Wed Jan 9 18:18:11 [initandlisten]连接被拒绝,因为连接太多:819 – adear11
This SO post may有帮助http:// stackoverflow。com/questions/7693989/increase-mongodb-maximum-number-of-connections – hek2mgl