mongodb索引创建作业的状态 [英] mongodb status of index creation job
问题描述
我正在使用MongoDB,并且有一个大约有7500万条记录的集合. 我通过使用以下命令在两个字段"上添加了复合索引:
I'm using MongoDB and have a collection with roughly 75 million records. I have added a compound index on two "fields" by using the following command:
db.my_collection.ensureIndex({"data.items.text":1, "created_at":1},{background:true}).
两天后,我试图查看索引创建的状态.运行db.currentOp()
返回{}
,但是当我尝试创建另一个索引时,出现此错误消息:
Two days later I'm trying to see the status of the index creation. Running db.currentOp()
returns {}
, however when I try to create another index I get this error message:
cannot add index with a background operation in progress.
是否可以检查索引创建作业的状态/进度?
Is there a way to check the status/progress of the index creation job?
要添加的一件事-我正在使用mongodb 2.0.6版.谢谢!
One thing to add - I am using mongodb version 2.0.6. Thanks!
推荐答案
在mongo shell上,键入以下命令以显示当前进度:
At the mongo shell, type below command to show the current progress:
rs0:PRIMARY> db.currentOp(true).inprog.forEach(function(op){ if(op.msg!==undefined) print(op.msg) })
Index Build (background) Index Build (background): 1431577/55212209 2%
这篇关于mongodb索引创建作业的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!