0

I was wondering how to configure sharding in a spring config file. I took a look at this post http://krams915.blogspot.com.es/2012/02/mongodb-replica-sets-with-spring-data_9536.html and seems to work for a single replica set. But in case you have a sharding envrionment with several replica set, mongos instances, ..., is spring-data currently supporting this?

Regards.

Ivan Fernandez
  • 4,173
  • 5
  • 25
  • 30
  • Just for put the question in context. I do know how to access to a sharded collection from spring-data with one mongos. The probtlems are: -How to configure application driver with two or more moengos. -Spring-data handles pretty well slaveOK property and set reading preference directly to slaves in a replicaSet configuration, but it doesn't in a sharded environment. – Ivan Fernandez Dec 18 '13 at 01:37
  • 1
    The spring-data client shouldn't care whether it is connecting to a mongod or mongos. Of course the command set available on each will differ. See the following page for more on spring-data/MongoDB configuration: http://docs.spring.io/spring-data/data-mongodb/docs/current/reference/html/mongo.core.html#mongodb-connectors – James Wahlin Jan 08 '14 at 18:22

0 Answers0