-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Mongo Connection String with Replica Sets #2446
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
Comments
"mongodb://user:[email protected]:27017,12.12.123.124:27017/dbname" you have not specified the ?replset=myreplset url param. so it will never work. |
having said that there IS an issue with mongo connections to replicasets. |
I was under the impression the replset parameter was optional, as it works properly on Parse.com even when either server is down. I can try adding that and see if it fixes the issue for me. |
As an update, I tried updating my connection string to look like this: |
@Vortec4800 please share your rs.config() from the mongo shell and any additional information about your topology, is it possible one of the addresses if for a mongos orthat you started a server with --shardsvr in addition to --replSet? |
There's my config. I've got 3 boxes, all on Digital Ocean, each running Ubuntu 14.04 x64. I do not have a shard configured. |
Maybe it's cause the one node is an arbiter... |
this works: mongodb://IP1:Port,IP2:Port/DBName?replicaSet=xxxx&w=1&readPreference=nearest&maxPoolSize=50 |
I recently started to see this today as well for new apps I have been creating. I only get this message when I change the database URL. I even try to restart all the services and I get it as well. I'm on the Azure Parse Managed Instance and it seems that their Parse stack is now Server version: 2.2.17. I see that the issue didn't start until Server version: 2.2.17. |
As mentioned before, if you take out all but the primary IP address in the database URI it works. Strange that it was actually working in 2.2.16 with Primary and Secondary String. |
Running a replicaset With mlab and No issue on my side either |
i can confirm this issue is happening at update from 2.2.16 to 2.2.17 It is throwing similar error as posted. warn: Unable to ensure uniqueness for user email addresses: MongoError: no primary found in replicaset "at /parse-server/node_modules/mongodb-core/lib/topologies/replset.js:558:32" |
Is it still open or closed as I am getting same problem with parse-server version ~2.2.2 |
@mohitgawande please update to 2.2.18... |
Still occurring on 2.2.19 (Express 4.14.0, hosting on MLab) |
This URI pattern work for me. |
Describe your issue in as much detail as possible.
Mongo connection strings with multiple IP addresses don't work.
My mongo string looks like this:
mongodb://user:[email protected]:27017,12.12.123.124:27017/dbname
I have a replica set with two replica servers and an arbiter. My parse server is on another box that does not have Mongo installed at all. The two IPs in my connection string point to the two replica servers, so if one goes down the connection string will still work.
This connection string works on Parse.com as expected, but when it's entered in parse-server I get this error:
warn: Unable to ensure uniqueness for usernames: MongoError: no mongos proxies found in seed list
If I change the connection string to look like this:
mongodb://user:[email protected]:27017/dbname
It does work.
Steps to reproduce
Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.
Expected Results
The server will connect to the IPs in order to access the replica set.
Actual Outcome
No connection is made and the error listed above is shown.
Environment Setup
Logs/Trace
You can turn on additional logging by configuring VERBOSE=1 in your environment.
The text was updated successfully, but these errors were encountered: