-
On the primary, edit /etc/mongod.conf so that it will start and join the
evgrs
replica set. -
On the primary, restart mongod
-
Get into a mongo console, and run the following series of commands:
// First we need to connect to the mongo console and copy the current configuration. cfg = rs.conf() printjson(cfg)
// For this step you need to identify the members you want to keep in the replica // set. In our case, this should probably be the primary that we want/trust and // the arbiter. That should allow the cluster to come back online. cfg.members = [cfg.members[?]]
// Now we force the modified copy of the configuration. rs.reconfig(cfg, {force: true})
-
Give the server time to move itself up to master. Confirm that this happens before moving on.
-
On each secondary, destroy everything in /var/lib/mongo
-
On each secondary, ensure they are configured to join the right replica set (
evgrs
) -
On each secondary, start mongod
-
On the primary, use the following commands to add each secondary to the replica set:
rs.add("hostname.evg.int:27017")
-
Wait for the secondaries to all resync.
Last active
August 29, 2015 14:07
-
-
Save plainprogrammer/63c243ec7c78f5fe28a2 to your computer and use it in GitHub Desktop.
MongoDB Forced Reconfiguration
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment