如何在MongoDB中启用锁定使用3.2.8 – 失败:服务器不支持报告锁定信息


MongoDB docs

To report the use of per-database locks, use –locks

Changed in version 3.0.0: When called against a mongod that does not
report lock usage, –locks will return a Failed: Server does not
support reporting locking information error

我收到此错误

mongotop -vvv --host localhost --authenticationDatabase admin -u $USER -p $PASSWD  --port 27100 --locks
2016-08-29T14:29:41.477+0200    Failed: server does not support reporting lock information

如何在MongoDB 3.2.8中启用锁定使用?我需要一个特殊的启动参数吗?

最佳答案 你不能. –locks选项用于报告每个数据库的锁定.

从MongoDB 3.0开始(对于大多数操作),MMAPv1存储引擎上有集合级锁,而wiredTiger和MongoRocks有文档级.您可以在此处找到有关并发的更多信息:
https://docs.mongodb.com/manual/faq/concurrency/

选项–locks仅对MongoDB 2.x有用

点赞