简体   繁体   中英

oplog enable on standalone mongod not for replicaset

I am running mongod as standalone server .now i want to enable oplog for it ,i want to know whether it is possible or not ?

I knew I can do this by creating single node ReplicaSet ,but I want to do this without replica set .

I got a reply from the MongoDb Team, and it's working fine.

To enable oplog on a standalone server, start mongo with master options.

On command line start mongod --master .

For conf file append the following line:

master=true

More details here .

For mongo 2.6 or greater the /etc/mongod.conf now uses a yaml format.

To enable the oplog add something similar to the below, note the replication: line may already exist, be sure to use spaces.

replication:
  replSetName: rs0
  oplogSizeMB: 100

Full documentation here: https://docs.mongodb.com/manual/reference/configuration-options/#replication-options

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM