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.
On some occasions, even though the above mentioned tests passes, network is still a problem. So please make sure you are not connected to any vpn and firewall/antivirus is disabled. You can also try to connect from some other network such as your home network .
Hope it helps!
If the issue still persists please feel free to get back to us. Happy Learning
Thanks,
Shubham Ranjan
Curriculum Support Engineer
SRV causes Compass to not see the Mongod instance.
Thanks for your reply. After trying again this morning (with absolutely no changes on my end, same saved ‘favorite’ connection) the problem seems to have resolved, and i can successfully connect.
I had of course already checked the ping, which showed all packets successful.
Thanks for your reply. After trying again this morning (with absolutely no changes on my end, same saved ‘favorite’ connection) the problem seems to have resolved, and i can successfully connect.
Thanks for your reply. After trying again this morning (with absolutely no changes on my end, same saved ‘favorite’ connection) the problem seems to have resolved, and i can successfully connect.
In Compass, network related issues manifest in so many ways that it is hard to keep it out of the consideration when debugging any issue and it is always preferred to make sure that at least these two basics tests are passing before going any further.
27017 is the port number on which the clusters are running. All the nodes in the Cluster0-shard-0 replica set which we use in our M001 : MongoDB Basics course runs on the same port i.e. 27017.
You can easily verify this by connecting to the cluster from the mongo shell and then running the command rs.status()
Yes, this is correct that the secondaries will not serve the read requests if the slaveOk property for the current connection has been set to false but for this replica set it does not apply because this property has been set to true and read from secondaries are permissible.
In your connection string if you have included the name of the replica set along with any of its members host and port address, you should not worry about which node is the primary because it will always connect you to the primary.
In this screenshot, I can see that the replica set name has been provided so which node is the primary is not of any concern here.
Yes, the primary nodes keeps on changing from time to time due to some very obvious reasons. The thread that you are referring to here was for one of our student’s sandbox cluster.
You can totally connect to the atlas class cluster using the SRV Records as it has been already configured for the same. For doing that please use the connection string mentioned below and select the SRV Record option.
cluster0-jxeqq.mongodb.net
Hope it helps. BTW, I like your debugging style and your engagement with the community. Keep up the good work
Thanks,
Shubham Ranjan
Curriculum Support Engineer
I didn’t take this course so I was none the wiser about the setup. I was expecting the setup to be similar to all other courses that use different ports per node. And I can now see that it’s running on the same port with different host names after login in yesterday for the first time.
Good to know for future debugging!
Good to know too! You guys don’t seem to recommend this option most times. Any particular reasons?
When the videos were recorded, Compass did not have this functionality. At the moment, we do not recommend this because it may create unnecessary confusion among the learners.
Thanks,
Shubham Ranjan
Curriculum Support Engineer