Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

db.setProfilingLevel(1, 10000) return error: "profile currently not supported via mongos"

Tags:

mongodb

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.

like image 722
Shu Avatar asked Jul 05 '13 02:07

Shu


1 Answers

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.

like image 120
Artem Mezhenin Avatar answered Sep 17 '22 21:09

Artem Mezhenin