-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
clusters including master/slave db hosts #12
Comments
You can connect to a replica set as described here: #4 'mongodb' => array(
'host' => 'db1.example.net:27017,db2.example.net:27017',
'database' => 'database',
'options' => array(
'replicaSet' => 'myReplSetName'
)
), I will try to make this more easier and better documented. |
I updated the DSN method an readme to allow an easier connection to multiple hosts d8f6b83. |
Looks good to me. Cleaner than what I was trying to implement. |
works great. |
hi @jenssegers I have followed the same configuration for connecting a cluster of databases.
any configuration I have missed here.? Thanks |
…lications (mongodb#12) * Add header documentation for classes & traits that can be used in applications * Precise mixed types when possible
…lications (#12) * Add header documentation for classes & traits that can be used in applications * Precise mixed types when possible
I'm trying to connect to a cluster of 2 databases.
I'm aware that you build the connection string in the getDsn function.
so I set some extra parameters in the config for mongo like below
and in getDsn I added this block:
However I continue to get this error:
MongoCursorException
ds031708-a0.mongolab.com:31708: not master and slaveOk=false
Is there something that I'm overlooking?
It seems that the connection string should be built properly if these conditions are met.
The text was updated successfully, but these errors were encountered: