Skip to content
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 - [Errno -2] Name or service not known #593

Closed
em0ney opened this issue Nov 19, 2016 · 1 comment
Closed

ServerSelectionTimeoutError - [Errno -2] Name or service not known #593

em0ney opened this issue Nov 19, 2016 · 1 comment

Comments

@em0ney
Copy link

em0ney commented Nov 19, 2016

Hi there,

Having issues getting mongo-connector running in my docker container.

I am attempting to run mongo-connector like so:

 $ mongo-connector --auto-commit-interval=0 --oplog-ts=/data/oplog.ts -m ${mongoUrl}  -a ${user} -p ${pass} -t ${elasticsearch}:${elasticport} -d elastic2_doc_manager -n ${nameSpaceSet} --continue-on-error

The mongoUrl I am using (mongodb://XXX.XXX.XX.3:27017,XXX.XXX.XX.2:27017,XXX.XXX.XX.1:27017) is comprised of the local ip addresses for each of these mongo nodes (when connected to VPN can confirm that I can connect to mongo manually). I have tried different varieties of this, with the ?replicaSet= parameter, and also trying to use the localDNS entries like those that come up in the error messages below.

Error Messages:

pymongo.errors.ServerSelectionTimeoutError: ip-XXX-XXX-XX-3.ap-southeast-2.compute.internal:27017: [Errno -2] Name or service not known,ip-XXX-XXX-XX-2.ap-southeast-2.compute.internal:27017: [Errno -2] Name or service not known,ip-XXX-XXX-XX-1.ap-southeast-2.compute.internal:27017: [Errno -2] Name or service not known

Here is the traceback:

2016-11-19 04:24:26,383 [ERROR] mongo_connector.util:92 - Fatal Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/mongo_connector/util.py", line 90, in wrapped
    func(*args, **kwargs)
  File "/usr/local/lib/python3.4/site-packages/mongo_connector/connector.py", line 263, in run
    main_conn['admin'].authenticate(self.auth_username, self.auth_key)
  File "/usr/local/lib/python3.4/site-packages/pymongo/database.py", line 1018, in authenticate
    connect=True)
  File "/usr/local/lib/python3.4/site-packages/pymongo/mongo_client.py", line 439, in _cache_credentials
    writable_preferred_server_selector)
  File "/usr/local/lib/python3.4/site-packages/pymongo/topology.py", line 210, in select_server
    address))
  File "/usr/local/lib/python3.4/site-packages/pymongo/topology.py", line 186, in select_servers
    self._error_message(selector))

Hope to hear from you soon with some guidance on this!

@ShaneHarvey
Copy link
Contributor

You must configure MongoDB to use hostnames that are resolvable by the mongo-connector server and the other replica members. For more details, see #391 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants