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

MongoDB:The Definitive Guide 2nd笔记之Seeing the Current Operations

2016-09-25 08:40 281 查看
查看当前操作

db.currentOp()


过滤查看

db.currentOp({"ns" : "prod.users"})


杀死操作,不是所有的操作都可以被杀死,**operations can only be killed when they

yield, so updates, finds, and removes can all be killed**

db.killOp(123)


**replication thread (which will continue fetch‐

ing more operations from the sync source for as long as possible) and the writeback listener for sharding.**

上面这两种操作被杀死后MongoDB会重新启动它们,但是杀死replication thread会停止复制操作,杀死writeback listener会使
mongos
错过一些重要的写入错误。

幽灵写入

组织幽灵写入的最好方法就是采用确认写入的方式:直到上一个写入已经完成再进行下一次的写入,而不是上一次写入的数据停留在数据服务器的缓冲区时就开始下一次写入。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: