Maintaining Primary in the Replica Set

16 views
Skip to first unread message

bichonfrise74

unread,
May 1, 2012, 5:13:06 PM5/1/12
to mongodb-user
I have 3 nodes; one primary (A), and 2 secondaries (B, C).

I like to make A to be primary all the time because I like to increase
the oplog size. I tried to do this:

On B and C, I ran this:
> rs.freeze(600)

On A, I did this:
$ sudo /etc/init.d/mongodb restart

Then on B and C, I do this:
> db.adminCommand({replSetFreeze: 0})

I get inconsistent result where A is becoming secondary. Is this the
right way to do it?
So, my question is how do you tell server A to be primary temporary
for the time being, and B and C to be secondary.

Scott Hernandez

unread,
May 1, 2012, 5:15:49 PM5/1/12
to mongod...@googlegroups.com
The way to do this is with the priority option:
http://www.mongodb.org/display/DOCS/Replica+Set+Configuration#ReplicaSetConfiguration-AdvancedConfigOptionalArguments
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>

bichonfrise74

unread,
May 1, 2012, 6:42:02 PM5/1/12
to mongodb-user
Is this something that I can do on-the-fly without restarting mongodb?



On May 1, 2:15 pm, Scott Hernandez <scotthernan...@gmail.com> wrote:
> The way to do this is with the priority option:http://www.mongodb.org/display/DOCS/Replica+Set+Configuration#Replica...

Scott Hernandez

unread,
May 1, 2012, 6:52:36 PM5/1/12
to mongod...@googlegroups.com
Yes, you can reconfig the replica set at runtime. You can change
priority/slavedelay/etc. for any member.
Reply all
Reply to author
Forward
0 new messages