I've got a MongoDB running on a medium EC2 instance and everything seems fine apart from the fact that I keep getting this error:

Could not connect to a primary node for replica set #<Moped::Cluster:70157124022400 @seeds=[<Moped::Node resolved_address="my_ip:my_port">]>

This seems to happen only when Sidekiq get a big loads of queued jobs, so the question is, is this a scalability issue?

Looking at the EC2 instance however, it rarely goes over 30% of CPU usage or 40% memory used.

  • What are your specific versions of Moped and MongoDB server? What sort of deployment do you have (replica set or sharded cluster)? Moped has had some historical issues with cluster monitoring/failover and isn't using an officially supported driver implementation (which would have explainable behaviour via the standard Server Discovery and Monitoring (SDAM) spec).
    – Stennie
    Commented Jul 28, 2017 at 20:34
  • For full compatibility and feature support for modern versions of MongoDB I would recommend using the officially supported MongoDB Ruby driver. For a comparison of features and motivation for replacing Moped in Mongoid 5, see: Ruby Driver 2.0, a Rewrite.
    – Stennie
    Commented Jul 28, 2017 at 20:34
  • Thank you for all comments. It turned the problem was performance with the server. The server was running at full capacity (100% cpu usage) and dropping connections as result. Commented Aug 4, 2017 at 12:33

1 Answer 1


As that error message say: It can not find IP address to "my_ip:my_port" named machine! ;-)

Check your configuration. Somewhere there is written that "my_ip:my_port"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.