[SERVER-4613] Resize Oplog for Slaves in replica set Created: 04/Jan/12  Updated: 27/Jul/16  Resolved: 27/Jul/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 1.8.2
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Lynn Hoang Assignee: Unassigned
Resolution: Done Votes: 0
Labels: logging
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Linux eprod-d25.websys.aol.com 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:52:25 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
Mongodb: mongodb-linux-x86_64-1.8.2


Participants:

 Description   

I have a mongodb that is configured for 100GB of Oplog. I want to shrink it down to 40GB.

root 20855 1 21 2011 ? 33-13:02:13 /db/mongodb/mongodb_current/bin/mongod --quiet --fork --replSet repset_a --oplogSize 100000 --config /db/mongodb/etc/mongodb.conf

Just want to confirm the followings are that the correct way to shrink Oplog (local* files) for the SECONDARY/SLAVE of a replica set:

(1). Shutdown Slave of replica set
(2). Change to --oplogSize 40000
(3). Restart the Slave



 Comments   
Comment by Ramon Fernandez Marina [ 27/Jul/16 ]

Reopening briefly to adjust resolution, apologies for the noise.

Comment by Scott Hernandez (Inactive) [ 04/Jan/12 ]

Yes, that would be fine. There is a slightly shorter method where you just save the last oplog entry into a temp collection or variable and then create the new oplog manually and insert in the new one.

Comment by Lynn Hoang [ 04/Jan/12 ]

Please provide details on how to seed the new oplog with the last entry. Please provide all details.
Is the procedure provided by http://www.snailinaturtleneck.com/blog/2011/02/22/resizing-your-oplog/ does the job?

Comment by Scott Hernandez (Inactive) [ 04/Jan/12 ]

No, you must remove the oplog before restarting but that will cause a full resync unless you seed the new oplog with the last entry.

Generated at Thu Feb 08 03:06:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.