-
Notifications
You must be signed in to change notification settings - Fork 479
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
ServerSelectionTimeoutError
on Dockerized Mongodb Replica Set
#391
Comments
Hello! Can you send us the mongo-connector logs? Also any and all information about how you're setting up docker would be useful. Thanks! |
At one installation, I have faced the same situation. As a workaround, connected to mongo (
I don't know if this has any downside but looks like working. |
@letsgolesco Hello, has the workaround above solved your issue? |
I have the same issue, also using docker containers. The fix with localhost:27017 doesn't solve the problem for me, because mongo-connector is running in a different container and hast no idea where localhost:27017 is.. I think the only solution is to use host names which can be resolved by
because otherwise host name resolution will fail from pymongo library. This solved the problem for me.. |
Thank you for the workarounds! I have added this issue to the FAQ. |
@aherlihy just for future reference, this issue is indeed because mongo-connector cannot resolve the hostnames inside |
The same issue with docker on mac osx. Because of mongodb
So we can performance |
I have the same issue. Strangely it ran for a while, but after rebooting and redeploying the swarm cluster, the error occurred. Can this be fixed instead? |
to get this to work on mac (osx has weird config with docker) with locally hosted mongo and mongo-connector in docker we had to add to our mac's hosts file
Then we updated replica set as stated above so
This worked good for us |
@vancouverwill hey man, i just wanna ask where did you get your mongo-connector in docker? |
@vancouverwill, when I config config = {
_id: "mongors",
members: [
{ _id : 0, host : "mongors1:27017" },
{ _id : 1, host : "mongors2:27017" },
{ _id : 2, host : "mongors3:27017" }
]
} I can't connect to mongo replica set mongo 'mongodb://localhost:2001,localhost:2002......' // external port Please ..... |
I'm trying to use Docker locally to test out mongo-connector but with no luck so far.
It works fine when connecting to a local mongod instance (i.e. just running
mongod --replSet singleNodeRepl
in terminal), but in Docker I get this error:ServerSelectionTimeoutError: Could not reach any servers in [(u'344da2f17060', 27017)]. Replica set is configured with internal hostnames or IPs?
For some reason, the IP address of the replica set member inside the Docker container is a hex string:
344da2f17060
.Any way to make this work in Docker?
Following the instructions here, I created a replica set in a docker container (i.e.
docker run mongo mongod --replSet singleNodeRepl
), executedrs.initiate()
from its mongo shell, loaded it up with some data and ran mongo-connector like so:mongo-connector -c mongo-connector-config.json -m 192.168.99.100:27017 -t 192.168.99.100:9200 -d elastic_doc_manager
The config only contains namespaces.
The text was updated successfully, but these errors were encountered: