[SERVER-3452] From single node to replica set without restart... possible? Created: 20/Jul/11 Updated: 29/Aug/11 Resolved: 20/Jul/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Brian Konash | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | replication | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux version 2.6.18-164.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Sep 3 03:28:30 EDT 2009 |
||
| Participants: |
| Description |
|
I have a single node running MongoDB 1.6.1 in production, and I'd like to create and then add it to a replica set. I'm wondering what the best way to do this is, and if I can do it without any downtime on the original production node. The approach I'd like to take is: 1. Create an arbiter node and add it to the replica set. The problem I'm running into is that I don't seem to be able to figure out how to add the original production node to the replica set without restarting it and adding the --replSet option on startup. Is there any way to do this without any downtime on the original production node? |
| Comments |
| Comment by Brian Konash [ 20/Jul/11 ] |
|
Here's my revised plan with mongodb1 and mongodb2 as database nodes and mongodb3 as the arbiter (all running on port 27017): 1. Restart MongoDB on mongodb1, adding "--replSet my-rs" parameter to add it to a new replica set. Does anything stand out as being incorrect about this? |
| Comment by Brian Konash [ 20/Jul/11 ] |
|
Awesome. Thanks! |
| Comment by Scott Hernandez (Inactive) [ 20/Jul/11 ] |
|
You must restart the single server to add --replSet and build the oplog (which could take a while depending on how large you make it, and who FS you have). You should restart the primary (existing) node first to create the replicaset, then add the arbiter and secondary. |