• { "_id" : 1, "x" : 1, "y" : 2 }
  • { "_id" : 2, "x" : 2, "y" : 4 }
  • { "_id" : 3, "x" : 3, "y" : 7 }
  • { "_id" : 4, "x" : 4, "y" : 10 }
  • { "_id" : 5, "x" : 5, "y" : 75 }

Big Data MongoDB in Big Data 3 years ago

  2   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

The oplog is operation logs that keep an update of all operations that modify the data stored in databases. We can define the oplog size while starting MONGODB by specifying the --oplog option. If we do not specify this option it will take the default values which is 5% of physical memory in case of wiredTiger. While the default value is sufficient for most workloads in some cases we may need to change the oplog size for the replica set.

OPlog size is CHANGED in a ROLLING manner, first, we change on all secondary and then a primary member of the replica set. To change oplog size

  • First we need to CONNECT to any secondary member.
  • Verify the size of current oplog by running below command on the local database.

use local

db.oplog.rs.stats().maxSize
  • Change the oplog size using ADMIN command replSetResizeOplog specifying a new size for oplog.
db.adminCommand({replSetResizeOplog: 1, size: "Size-in-MB"})
  • Repeat the same process for other secondary members and then on the primary member of the replica set.

Posted on 31 May 2022, this text provides information on Big Data related to MongoDB in Big Data. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.