EnableWriteMajority

11 views
Skip to first unread message

Olivier Brun

unread,
Aug 26, 2016, 6:06:16 PM8/26/16
to mongodb-user
Hi all

where must I put this command in my command file?

EnableWriteMajority=true


----------
 storage:
  2    engine: wiredTiger
  3    dbPath: "/home/sirc2/data/mongod-32000"
  4    directoryPerDB: false
  5    journal:
  6       enabled: false
  7 systemLog:
  8    destination: file
  9    path: "/home/sirc2/data/log/mongod-32000.log"
 10    logAppend: false
 11    logRotate: rename
 12 processManagement:
 13    fork: true
 14    pidFilePath: "/home/sirc2/data/pid/mongod-32000.pid"
 15 net:
 16   port: 27017
 17   http:
 18     enabled: false
 19     RESTInterfaceEnabled: false
 20 replication:
 21    replSetName: myreplset
 22    oplogSizeMB: 50
~
----------
Thank you!



~
~
~
~
~

Amar

unread,
Aug 29, 2016, 2:09:46 AM8/29/16
to mongodb-user

Hi Olivier,

Could you provide more information about what you are trying to achieve and where did you find a recommendation to set EnableWriteMajority=true?

Currently as of MongoDB 3.2.9, there is no such parameter for mongod as EnableWriteMajority. You can set w : majority as Write Concern on the client side, either in Mongo Shell or on a MongoDB Driver. Please keep in mind that different clients can use different write concerns as needed without changing configuration on mongod, therefore, it’s a client operation parameter rather than a server parameter.

For example, using Mongo Shell, you could specify:

db.collection.insert( {a : 1}, {w : 'majority'} )

You can check the relevant MongoDB Driver Documentation. Here is an example from the Java Driver.

Regards,

Amar


Reply all
Reply to author
Forward
0 new messages