-
Notifications
You must be signed in to change notification settings - Fork 231
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
Replica set connection issue #374
Comments
To add further, I've added Does the |
FWIW I'm using following DSN: |
Good news is that adding replicaSet has resolved our issue. However if you don't add replicaSet config setting it seems to ignore readPreferences and round robins to the mongo server names listed in the server config setting. Wonder whether this needs a documentation update or is my reading of this incorrect? |
I think this is just how mongo driver behaves but I don't mind adding a tip in our docs if we have something more on replica sets :) |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions. |
I believe adding a link to the connection string reference in the MongoDB docs should help in the future. Adding to the roadmap. |
Hi there,
I'm trying to connect to my replica set within Symfony. I have my config settings as follows as per http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/config.html#connecting-to-a-pool-of-mongodb-servers-on-1-connection
However I get the error:
Uncaught PHP Exception MongoException: "Cannot run command count(): not master and slaveOk=false"
Let me add a bit of context. Primary is
*.*.*.1
and I want to be able to connect via*.*.*.2 or *.*.*.3
if primary goes down and one of the secondaries then become primary. If I go with just the primary mongo server IP address, instead of a comma'd list of my servers, I can connect fine, but that fails if*.*.*.1
goes down and*.*.*.2
becomes primary for example.Has anyone any suggestions?
Regards
Paul Pounder
The text was updated successfully, but these errors were encountered: