0

Mongodb version 2.6.10
Ubuntu 14.04

Currently having a replica set of 4 nodes , my read preference is Primary Only , I configured one node with priority 0 Also i have a file on the priority 0 node /etc/mongorc.js that contain

rs.slaveOk()

so you can always read from this node.

Does that guarantee that reads are only done on this secondary Only, Considering that the application is connecting to the Machine using ODBC driver on windows server

  • Shouldn't your read preference be Secondary Only then? and to be save, I would use secondaryPreferred ... in case your secondary is down, it would look for the Primary. – aldwinaldwin Aug 27 '15 at 3:16
  • where should i specify that , ODBC or Mongodb ? – Hamza Faouri Aug 27 '15 at 9:37
  • At application level. I don't know about ODBC. – aldwinaldwin Aug 27 '15 at 9:41
  • @HamzaFaouri Erm, four nodes? Guy, you should really start to read the docs. As for the readPreference: since this usually depends on the query, the place to set your default readPreference is during driver initialisation, which can be modified for each query in the drivers. – Markus W Mahlberg Aug 28 '15 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.