-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.3
-
Component/s: Sharded Cluster
-
None
I am currently using Mongoid 5.2.1 and Mongo 2.4.3
My mongoid yml config file looks something like this:
production:
clients:
default:
hosts:
- 1.1.1.1:27017
- 1.1.1.2:27017
- 1.1.1.3:27017
If I type User.collection.cluster I am returned:
=> #<Mongo::Cluster:0x69935083945360 servers=[#<Mongo::Server:0x69935083943980 address=1.1.1.1:27017>, #<Mongo::Server:0x69935083909280 address=1.1.1.2:27017>, #<Mongo::Server:0x69935083889460 address=1.1.1.3:27017>] topology=Sharded>
So I see that the mongo gem is aware that my topology is "Sharded" and has the correct list of server addresses, but all my client requests go only to the first server listed, 1.1.1.1:27017.
I searched the code base for a config option to evenly or randomly distribute my client requests to all three Mongos servers, but I do not see one.
Thanks!