Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7637449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:56:34+00:00 2026-05-31T07:56:34+00:00

I switched my mongodb environment from replication-sets to sharding with replication-sets through mongos. I

  • 0

I switched my mongodb environment from replication-sets to sharding with replication-sets through mongos.

I had 3 rep-sets (A,B,C) which I switched to S1(A,B); S2(C,D) with mongoS running on A,B,C,D.

When I was connecting to my old system, I connected as followed

new Mongo("mongodb://A,B,C", array("replicaSet" => "repset-name"));

Now I tried to to the same with mongoS wich throws an interal server error

new Mongo("mongodb://A,B,C,D", array("replicaSet" => "repset-name"));

If I get rid of the “replicaSet” option, it works again.

new Mongo("mongodb://A,B,C,D")

I was wondering if mongoS now balances the reads between the rep-sets in the shard (e.g. S1 balance between A and B) without the “replicaSet” option set?

By the way, pymongo reacts the same way with a pymongo.errors.AutoReconnect “No address associated with hostname”.

Thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:56:35+00:00Added an answer on May 31, 2026 at 7:56 am

    Correct, once you’ve sharded, you should connect your driver to the mongos as if it were a single server. Mongos is now responsible for distributing reads and writes among the primaries and secondaries around your cluster. Set slaveOk to True for reads if you want mongos to distribute reads to secondaries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$ mongo MongoDB shell version: 2.0.0 connecting to: test > use admin switched to
EDIT: Switched from XmlTextWriter to XElement I have a Player class, which has following
Just switched to Mac from Windows and in ppt on Windows I had an
I have recently switched from Netbeans to Eclipse. I have a project which contains
I switched my DAL from using LINQ over to Entity Framework. Because my application
Just switched over from eclipse to vs 2008 for debugging javascript, i feel more
I've recently switched from being an employee of a small consulting company to being
We recently switched our Windows software packages from RPM (cygwin) to MSI (wix). Having
My company unwittingly switched from cvs to subversion and now we're all wishing we
I switched from Zend Debugger to XDebug, while I got XDebug to work fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.