MongoDB – Not Master and SlaveOk Error Message


When trying to access MongoDB database collection data using command such as show collections on one of the secondary member of the replica set, error message such as not master and slaveOk=false occurs. Following screenshot represents the same:

MongoDB - SlaveOk Error Message

Figure 1. MongoDB – SlaveOk Error Message

Following command when executed on secondaries resolves the above shown error:

Ajitesh Kumar

Ajitesh Kumar

Ajitesh is passionate about various different technologies including programming languages such as Java/JEE, Javascript, PHP, C/C++, mobile programming languages etc, and, computing fundamentals related with cloud-native technologies, application security, cloud computing platforms, mobile apps, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.