我在 mongod.cfg 中添加配置时总是遇到问题。
现在我想根据 this suggestion 启用操作分析: 指定慢速操作的阈值
systemLog:
destination: file
path: C:\Mongo\log\mongod.log
logAppend: true
storage:
journal:
enabled: true
dbPath: C:\Mongo\db
operationProfiling:
mode: 2
slowOpThresholdMs: 500
slowOpSampleRate: 1.0
但是当我想从服务启动 mongodb 时出现错误:
Error1053:The service did not response to the start or control request in a timely fashion
cfg文件哪里错了?居然没有
operationProfiling:
mode: 2
slowOpThresholdMs: 500
slowOpSampleRate: 1.0
服务已启动,但是当我添加此配置时出现错误。
*****编辑*****
我使用的是 mongodb 3.6
最佳答案
Mode 是一个字符串值,默认为关闭,因此在您的情况下您需要打开,如下所示: 模式:开
关于mongodb:指定慢速操作的阈值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48763238/