0

I have configured my production environment with the following details:

1. Three config server
2. Two router(mongoose)
3. Two shards of three replica set.

My question is, I am trying to connect to the sharded database with the help of mongo java driver. So, if I give my two mongoose IP for connection,how will it select one mongoose for routing data, in other words which mongoose will be selected as the primary router and how the other one will be picked if one goes down.

Phalguni Mukherjee
  • 623
  • 3
  • 11
  • 29

1 Answers1

2

As stated by Jeff Yemin on the google user group ( http://grokbase.com/t/gg/mongodb-user/1395cqbag0/how-does-mongo-driver-pick-best-mongos#20130906wb6qy77tgwrf7p75aevf22mif4 ) the Java driver will actually use the first mongos to respond to a ping.

So if your application is geographically distanced and you have a mongos in each geographic location then separate processes of your application could use different mongos instances based on what is optimal.

Sammaye
  • 43,242
  • 7
  • 104
  • 146