Rajnish
Rajnish

Reputation: 1351

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 .

Upvotes: 17

Views: 15233

Answers (2)

TechplexEngineer
TechplexEngineer

Reputation: 1928

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

Upvotes: 7

Rajnish
Rajnish

Reputation: 1351

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.

Upvotes: 21

Related Questions