[ ]$/paic/mongodb/base/3.0.4/bin/mongod --config=/paic/mongodb/mg23001/etc/mg.cnf--profile=2
about to fork child process, waiting until server is ready for connections.
forked process: 5001
child process started successfully, parent exiting
[]$/paic/mongodb/base/3.0.4/bin/mongo --host ${IP} --port ${PORT} -uusername -ppassword admin
MongoDB shell version: 3.0.4
connecting to: 10.31.224.20:23001/admin
t1pamipm:PRIMARY> db.getProfilingLevel()
2
Profiling功能有3个级别:
0 – 不开启
1 – 记录慢命令 (默认为>100ms)
2 – 记录所有命令
使用如下命令查询记录。
db.system.profile.find()