Increase oplog size in replicaset

69 views
Skip to first unread message

roberto cirillo

unread,
Jul 27, 2016, 9:36:39 AM7/27/16
to mongodb-user
Hi all,
 In an existing Replica set (1 primary 2 secondaries) I need to increase the oplog size from 5GB to 10 GB. I've found in the official documentation a procedure to do it: https://docs.mongodb.com/manual/tutorial/change-oplog-size/

Are really needed all these steps? Or it could be simplified  with the following steps for every secondary member:

- stop the secondary member,
- increase oplog size;
-restart the secondary member.

and for primary:

- stepDown
- repeat the secondary's procedure

Thanks in advance

Roberto

William Hagan

unread,
Jul 27, 2016, 11:30:35 AM7/27/16
to mongodb-user
Hi Roberto,

You will need to be connected to the running mongod instance of the secondary in order to change the oplog size as such, the instance will have to be restarted in standalone mode and on a different port to prevent other replica set members from communicating with it.

Also, being that the oplog is a capped collection, it can only be recreated and not modified.

So, I think the steps highlighted in the docs are necessary - except of course backing up the existing oplog collection.

Cheers

roberto cirillo

unread,
Jul 27, 2016, 11:57:11 AM7/27/16
to mongodb-user
Thank you William for your reply.
So,  if I need to do a full resynch on a secondary member (deleting all the data). Could I just increase the oplog size before start the resynch?

I assume, with a full resynch, the oplog collection is re-created from scratch.

Cheers

William Hagan

unread,
Jul 27, 2016, 1:20:37 PM7/27/16
to mongod...@googlegroups.com
Yes, before the secondary rejoins the replica set, you should set the oplog size.

A resync wouldn't recreate the oplog collection from scratch.

Cheers.


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/dH7_jNI9fog/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/33a7273e-cdc6-49f7-818e-bc9765d4d993%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Never be afraid to try something new. Remember that a lone amateur built the Ark. A large group of professionals built the Titanic.
Reply all
Reply to author
Forward
0 new messages