-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: replica set support #12
Comments
Any plans for this? |
interested too! |
+1 |
1 similar comment
+1 |
I'd love tihs |
Just implemented this feature in my fork, going to check it out in production |
Hi @fl00r, |
@ivobenedito, a week in prod. While mongodb master get down, client successfully reconnected |
@fl00r Cool ;)!! I'm mounting a ReplicaSet on my localhost to also make some failover tests. |
It will be good to get some feedback :) EM::Mongo::Connection.new_replicas([host:port, host:port, ...], timeout, reconnect_in: 1000) |
@fl00r Thanks for showing the syntax usage. Did some tests with it yesterday. EM::Mongo::Connection.new # simple connector
EM::Mongo::ReplicaSetConnection.new # replset connector
# currently, the original mongo driver updated to this
Mongo::MongoClient.new # simple connector
Mongo::MongoReplicaSetClient.new # replset connector |
@fl00r Also, think I might have found a bug. I'm using a ReplicaSet with 3 members, everytime I shutdown the primary and a secondary from the remaining 2 gets elected to master, the client works fine. Meanwhile, if I shutdown another member (primary) and only leave 1 active (secondary), mongo doesn't elect the secondary to primary without an arbiter, which means the ReplSet stops working. Then, If I bring another member in again, a primary is elected but the app/driver can't find it anymore. Have you covered/tested this use case? |
Right now driver tries to reconnect few times with In production you should raise an error and stop your application in case if after some retries client can't reconnect. Then you will get some alerts from production and then somehow solve your problem and start your application again (we use runitd for supervising our applications). So you should pass About naming. In my first iteration I've created |
Hi. As far as em-mongo isn't supported enough I've begun to write new MongoDB Client on EventMachine. https://github.com/fl00r/monga If somebody interested - welcome! |
@fl00r if you have any interest in taking over em-mongo, or just taking the name once you have feature parity, I would be more than happy to hand over the keys (to the gem as well). At the very least let me know when you think monga its stable for production use and I will make mention of it in the README. I haven't used MongoDB in a long, long time and probably never will. cc: @ivobenedito |
Hello! Somehow github removed all my notifications :/ |
I've rewritten my client to support all kind of interfaces: blocking (over TCPSocket), synchronous (over Fibers on EventMachine) and asynchronous (over EventMachine). But API has changed because I've used callbacks instead of Deferrable. Going to rewrite Wiki and Readme soon |
@fl00r I've seen that you've implemented replica set support on your repo (some time ago, I know). If you like to, it would be a great thing to merge your commits into this here. |
It would be great to support connecting to replica sets.
http://www.mongodb.org/display/DOCS/Connecting+Drivers+to+Replica+Sets
The text was updated successfully, but these errors were encountered: