I have set up my MongoDB on local machine with replicaSet, and I have this error:
An error occurred while loading navigation: 'not master and slaveOk=false': It is recommended to change your read preference in the connection dialog to Primary Preferred or Secondary Preferred or provide a replica set name for a full topology connection.
If I don't exec this command on secondary servers,
rs.slaveOk()
After using the command, the problem is solved, but only temporarily. After restarting the servers, the above error pops up again, I again have to stop it using the command.
How can I somehow define the slaveOk
in a config file, so that I don't have to allow slaveOk
each time I start the server?