1

I configured cluster with 2 secondary node. So, totally 3 node(1 primary, 2 secondary). My intention is to dedicate one of the secondary node to an application for read only. But, i could not find the connection property to achieve this. Can anyone help me on this.

Ganesan G
  • 59
  • 7

1 Answers1

1

By setting secondaryPreferred as the read preference.

The documentation statues for secondaryPreferred in most situations, operations read from secondary members but if no secondary members are available, operations read from the primary

Note: You can tune your secondary read preference by configuring maxStaleTimeout

Please follow below link for more documentation and understanding about read preference https://docs.mongodb.com/manual/core/read-preference/

ROHIT KHURANA
  • 903
  • 7
  • 13