[SERVER-2402] Allow for replica set initialization via CLI options and/or config file Created: 24/Jan/11  Updated: 06/Dec/22

Status: Open
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: features we're not sure of

Type: Improvement Priority: Major - P3
Reporter: Micah Wedemeyer Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

It would be very nice if there were a way to tell the mongo server to initialize a replica set automatically after starting up. For automated sysadmin setups (like Chef), it can be very difficult to fully bootstrap several mongo nodes for a replica set. This is due to the fact that you have to wait for the server to come up, then call rs.initialize() in the shell. If there were some way via the CLI options (and config file) to instruct the server to do this automatically, it would make automated bootstrapping much, much easier.



 Comments   
Comment by Micah Wedemeyer [ 25/Jan/11 ]

Thought I'd toss it out there, but it seems like there's not a lot of support for the idea, or it's at least not the preferred solution. I understand.

Comment by Scott Hernandez (Inactive) [ 25/Jan/11 ]

Also, as noted in the email, using ext3 is a bad idea as it is extremely slow to allocate space.

You can specify an --oplogSize to reduce the default 10% of free space, or increase it...

Comment by Kristina Chodorow (Inactive) [ 25/Jan/11 ]

This isn't really an issue in 1.7 and beyond, as the files aren't zeroed until you call rs.initialize(). So, the replica set can be initialized immediately on startup.

Comment by Micah Wedemeyer [ 25/Jan/11 ]

The main issue with scripting it is that the server can take a pretty long time to come up if it's busy zeroing out files. So, with a scripting framework like chef, you pretty much have to sit and wait while it's coming up. Plus, if I'm not mistaken, if you try to run the --eval command before the server is finished zeroing the files, the command fails.

Comment by Eliot Horowitz (Inactive) [ 25/Jan/11 ]

Not sure that makes sense as its a one time thing, and can cause problems later.

It should be pretty easy to script with the shell using --eval

Generated at Thu Feb 08 02:59:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.