您的位置:首页 > 其它

Error creating index WriteConcern detected an error 'not master'

2016-04-26 16:09 239 查看
Error creating index
WriteConcern detected an error 'not master'. (Response was { "lastOp" : { "$timestamp" : NumberLong(0) }, "connectionId" : 2152576, "err" : "not master", "code" : 8, "n" : 0, "ok" : 1.0 }).
Type: MongoDB.Driver.WriteConcernException
Stack: 在 MongoDB.Driver.Operations.InsertOperation.Execute(MongoConnection connection)
在 MongoDB.Driver.MongoCollection.InsertBatch(Type nominalType, IEnumerable documents, MongoInsertOptions options)
在 MongoDB.Driver.MongoCollection.Insert(Type nominalType, Object document, MongoInsertOptions options)
在 MongoDB.Driver.MongoCollection.Insert[TNominalType](TNominalType document, MongoInsertOptions options)
在 MongoDB.Driver.MongoCollection`1.Insert(TDefaultDocument document, MongoInsertOptions options)
在 MongoDB.Driver.MongoCollection.CreateIndex(IMongoIndexKeys keys, IMongoIndexOptions options)
在 MangoUI.MIndexes.Create(String db, String col, String name, BsonDocument fields, Boolean unique, Boolean dropDups, Boolean background)
在 MangoUI.WinIndexNew.btnCreate_Click(Object sender, EventArgs e)
Inputs::
results: System.Collections.Generic.List`1[MongoDB.Driver.WriteConcernResult]
Command: getlasterror
Ok: True
ErrorMsg:
Request: { "getlasterror" : 1, "w" : 1 }
Response: { "lastOp" : { "$timestamp" : NumberLong(0) }, "connectionId" : 2152576, "err" : "not master", "code" : 8, "n" : 0, "ok" : 1.0 }

解释

当前mongodb不是master,索引只能在master上建。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: