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.
Asked
Active
Viewed 1,199 times
1
-
Use tags....... – D. SM Mar 10 '21 at 14:22
-
Don't really understand your question... You use rs.add() command to add node to RS – JJussi Mar 11 '21 at 05:45
-
@JJussi: Edited my query. Can you please help me. – Ganesan G Mar 11 '21 at 07:02
1 Answers
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