您的位置:首页 > 数据库 > Mongodb

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

2017-11-06 11:09 573 查看
原因是使用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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐