I'm new to MongoDB and need some help to understand how profiler works with replication in Mongo.

I have a replica set with three instances and the secondaries are used for read only by the application. When I try to profile by connecting to the cluster it only returns commands issued on the primary. How can I get all commands, especially the ones which were executed on the secondaries replica set?


I found out the answer in the documentation:

You can enable and configure profiling for individual databases or for all databases on a mongod instance. Profiler settings affect only a single mongod instance and will not propagate across a replica set or sharded cluster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.