开发者

Lithium Mongodb error on remote connection

I have the following issue with Lithium. When I connect to mongodb on my localhost all works well, but when I connect to my remote mongodb on EC2 it gives me the following error:

Fatal error: Uncaugh开发者_高级运维t exception 'MongoCursorException' with message 'Operation now in progress' in /Library/WebServer/Documents/v0.4/libraries/lithium/data/source/MongoDb.php:430

Both mongodb versions are the same (1.8.0) and I can connect to my remote mongodb with the shell. I'm running lithium 0.9.9, mongo php driver 1.1.4 and php version 5.3.4, on Mac osx snow leopard.

Any suggestions?

Update: I have tried with the latest master version, but still have the error. You can view my full stack trace here: http://pastium.org/view/90c1dd7201eca845913c4101a205a023


This error is often associated with a timeout of the connection to the database.

This is more likely to happen when the web-server and the MongoDB server are on different hosts, networks, or providers (like EC2 in your case) due to network latency ...

The default timeout set in Lithium is 100 ms, which can be too slow for some network configurations (however it should generally be perfectly fine.)

This is documented here: Lithium MongoDB Adapter

Lithium Mongodb error on remote connection

You can see the default MongoDB connection configuration in Lithium here: (line 153 at this time) ...

https://github.com/UnionOfRAD/lithium/blob/master/data/source/MongoDb.php

From the comments on that page,

'timeout' integer: The number of milliseconds a connection attempt will wait before timing out and throwing an exception.

Defaults to 100

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜