Try to enable oplog locally
Add to C:\\Program Files\\MongoDB\\Server\\4.2\\bin\\mongod.cfg
replication:
replSetName: rs0
oplogSizeMB: 100
Restart mongod, but local.oplog does not exist
How correctly enable oplog?
UPD: Use MongoDB 4.2, Windows 10
Add the replication configs in the mongod.cfg
file.
Restart MongoDB from services.
Open MongoDB from a command prompt.
Execute the following command in the mongo terminal:
rs.initiate({_id:"rs0", members: [{"_id":1, "host":"127.0.0.1:27017"}]})
After that you'll see something like this:
{ "info" : "Config now saved locally. Should come online in about a minute.", "ok" : 1 }
Switch to the local database using use local
.
You can verify oplog.rs
by viewing the collections using: show collections
You'll see that oplog.rs
will be listed along with other collections.
oplog.rs
replset.election
replset.minvalid
replset.oplogTruncateAfterPoint
startup_log
system.replset
system.rollback.id
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.