question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ServerSelectionTimoutError` on Remote Replica Set

See original GitHub issue

I’m trying to connect from a remote MongoDB instance to a local Elasticsearch instance. The MongoDB instance is a replica set behind a proxy, and I’m connecting with SSL. I’ve tried tweaking things with varying degrees of success, the closest I’ve gotten is when I hit this error:

ServerSelectionTimeoutError: <ip_address_1>:27017: timed out,<ip_address_2>:27017: timed out,<ip_address_3>:27017: timed out

The 3 IP addresses it lists are correct for the replica set members, which indicates to me that it’s actually connecting/authenticating properly, but some issue occurs afterward.

The command I’m using looks like this: mongo-connector -c mongo-connector-config.json -m mongodb://<ip_address>:<port>/?ssl=true -t 192.168.99.100:9200 -d elastic_doc_manager --ssl-ca-certs my-cert.pem --ssl-certificate-policy optional

The only things I’m specifying in my config are noDump: true and a few namespaces.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:25 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
benlavalleycommented, May 8, 2019

@pratyus Nice job with the fix, implemented it for my app’s architecture and it works fine.

1reaction
pratyuscommented, Oct 20, 2017

Friendly ping to take a look at the PR. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

ServerSelectionTimeoutError on mongo replica set using ...
To get a connection to a MongoDB replicaset from an external client, you must be able to resolve the hostnames from the local...
Read more >
pymongo.errors.ServerSelectionTimeoutError with atlas even ...
This error means that pymongo timed out while waiting for a response from the remote server. Usually this means there is a network...
Read more >
ServerSelectionTimeoutError on mongo replica set using ...
To get a connection to a MongoDB replicaset from an external client, you must be able to resolve the hostnames from the local...
Read more >
Connecting to a replica set member in the RSGhost state ...
Connecting to a replica set member in the RSGhost state without directConnection=True leads to a "connection pool paused" error.
Read more >
No replica set members available for replica set name "abc ...
MongoDB ServerSelectionTimeoutError: No replica set members available for replica set name ... I also can connect to one remote database.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found