[SERVER-2718] Can't add replica to set when it is not already in config Created: 09/Mar/11 Updated: 30/Mar/12 Resolved: 11/Mar/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.6.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew | Assignee: | Kristina Chodorow (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
Start three nodes, add them to a replica set using the instructions on Now we follow these steps to add a new member from a backup: But it doesn't go as well as the docs suggest. Here's what happens. Create a new data directory /data/r3 and copy files from another mongod's data directory. Start up a new node using mongod --replSet foo --port 27020 --dbpath /data/r3 --fastsync This new mongod will log an error about not being in the replica set config. This error looks like (from Windows binary): Tue Mar 08 22:39:15 [startReplSets] replSet error can't find self in the repl set configuration: , { _id: 1, host: "localhost:27018" }, { _id: 2, host: "localhost:27019" } ] } Ok, well then maybe we just need to do rs.add("localhost:27020") from the master. Do that, restart the new mongod, it still fails with the same error. Now what? Is the implication here that you can only restore from backups that include the new set member in the replica set config before taking the backup? |
| Comments |
| Comment by Andrew [ 09/Mar/11 ] |
|
The only workaround I can find is to do the following: == On the original master == 2) Copy the Javascript blob you get from rs.conf(). == Now on the new node == , <paste conf blob from master here>); 4) Restart the new node, it should now properly join the set. |