I use mongo v2.2.1. My mongod are running by three sharding. I want to profile and find my slow queries. So, I use setProfilingLevel(1, 10000) on mongos.
$ mongos
mongos> db.setProfilingLevel(1, 10000);
{ "ok" : 0, "errmsg" : "profile currently not supported via mongos" }
Why the error is occurred? and please teach me how to enable profile.
Collection system.profile is not sharded, this is why you have to manually enable profiling on each of your shards(not from mongos
). You also won't be able to query system.profile though mongos
, you'll have to use mongo
shell on each shard.
UPD I found interesting post on this topic. You should try this solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With