mongo抛出异常:com.mongodb.MongoException: Lock not granted. Try restarting the transaction 解决方式

来源:互联网 发布:易语言qq登陆器源码 编辑:程序博客网 时间:2024/06/07 05:11

原因是使用findandmodify中的query 条件对应的字段没有建索引,导致mongo查询缓慢,形成工作队列,在mongo中建好索引后问题得到解决。

db.demo.createIndex({"id": 1}, {name: "index_id"});

参考链接:点击打开链接

I have some problem.
I am actually getting this error because of a lot updates without the right index.
It looks like each update requires too much time, so the queue of operations increases, and a lock related timeout is fired, and the operations on the queue are dropped out.After having setted the index up, the error does not appear anymore.


阅读全文
0 0
原创粉丝点击