Friday, 17 March 2017

MongoDB: Not enough nodes match write concern mode

Following mongodb insert operation gives an error:

db.dumpset.insert( { id: "xyz", status: "A" }, { writeConcern: { w: "activeNodes" } } )

WriteResult({
    "nInserted" : 1,
    "writeConcernError" : {
        "code" : 100,
        "errmsg" : "Not enough nodes match write concern mode \"activeNodes\""
    }
})

There are 3 nodes in replica set tagged with production and the custom writeConcern looks like below:

"getLastErrorModes" : {
            "activeNodes" : {
                "production" : 3
            }
        }

MongoDB version 3.2.11, is there anything missing?



via Astro

No comments:

Post a Comment