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
How to connect using multiple nodes #855
Comments
The connection string is simply passed to pymongo. Could you try the pymongo uri parser and see if your string is parsed correctly? |
Hi, it seems is parsed correctly (replaced actual values): {'collection': None, What can I do? |
Could you could try setting up a little python script which uses pymongo and your uri, bypassing Eve? |
Good idea, I wrote this script and it worked (I needed
I tried to use the same connection string in Eve using MONGO_URI option but it failed again, trying to connect to localhost instead of remote MongoDB. How can I pass these options to Eve? |
Eve relies on Flask-PyMongo. Now, according to this ticket FPM does not support ssl and/or cert ca as parameters. I suspect that's the issue with your connection string. You might want do the same experiment with Flask-PyMongo instead of barebone PyMongo, and see if it works on your setup. If the issue is with FPM, we will have to wait until it is fixed upstream. |
I did this test and it worked:
So it seems Flask-PyMongo actually supports this kind of connections. |
Any idea on how can we fix this on Eve? Thanks! |
Hi, I just merged #990 with a fix for |
Hi, I need to test again, as I am currently using an older version of Eve. |
It seems the problem is in Flask-PyMongo. I tried the following:
I played a little with Flask-PyMongo and it seems they parse MONGO_URI and then assemble it again instead of just bypassing to pymongo. Don't know why. Doesn't seem to me like a good idea. |
The Flask-PyMongo seems to be abandoned. 0 contributions in 2017. |
Flask-PyMongo dependency was just dropped on branch v0.8. |
FYI, the v0.8 tag still requires flask-pymongo in setup.py. |
Yes, good catch. It is fixed in v0.8.1. |
Hi, thank you for this awesome project!
I am having trouble trying to connect to a Mongo 3.2.1 database which uses this string, provided by Compose.io:
mongodb://<user>:<password>@<host1>:<port1>,<host2>:<port2>/<db-name>?ssl=true
I tried using MONGO_URI in the configuration dictionary but it tries to connect to a local server:
Not sure how can I set my connection string, currently I am using just one node using these variables:
But I need to be able to use both to handle failover between nodes.
Any idea?
The text was updated successfully, but these errors were encountered: