-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
Description
Hi!
I have a replica set of three nodes, and I want rename it.
The documentation https://docs.mongodb.com/manual/tutorial/rename-unsharded-replica-set/ says that in order to rename a replica set I have to:
- make a backup,
- stop all nodes of the replica set,
- change the name of the replica set to mongod.conf (I'm using a configuration file),
- enable them without a replica set,
- change the name of the replica set in the locale database,
- enable all nodes again as a replica set.
The backup is needed as insurance against incorrect actions when renaming a replica set.
Then I can do this:
- Change the replica set name in the configuration file,
- Change the replica set name in the locale base on each node sequentially,
- Turn off successively the secondary nodes,
- Restart the primary node,
- Turn on the secondaries of the node in sequence.
During times 1 and 2, the set is available for writing and reading. At time 3, it is read-only. i tested this on 4.2+ versions with C# driver.
This way, I minimize the time the replica set is unavailable until the restart time of the two nodes.
Why is my varinat dangerous? What problems can arise if you do this?