Passing the M201 “Chapter 5: Performance on Clusters” and faced an issue with the reading of data from the secondary node of my replica set, whereas I can’t find whether my collection is present on my SECONDARY node. Please suggest how to check this in any way.
Here is what I would do to check:
Could you show what is on the primary (show dbs), also is this a sharded cluster?
From the primary I would do these two commands
rs.status() and look if you can see the secondaries are listed and what “state” they are in.
If the nodes show up and are health then run:
rs.printSecondaryReplicationInfo() – this will show you if the nodes are replicating and if there is any lag.
Thanks for the comments. In order to properly use the rs.slaveOk() command, you should log in to that particular SECONDARY node with an appropriate privilege and authentication.