If so, how?
When I first created the replica set, I chose a confusing name; I’d like to change it now.
The replica set name is mentioned in /etc/mongod.conf, and I’m not sure when it reads/rereads that. Since the replica set name can also be passed in as a command-line parameter, I’m assuming (and currently testing) the following:
- it just uses replica set name once on startup while syncing up with other nodes
- I have to reconfigure, stop, change
replSetCLI argument orreplSetvalue in/etc/mongod.conf, then restart
In other words, I’m assuming the answer to my original question is “no, you must restart” or “no, replica set name is immutable”. I’ll probably figure this out soon enough since I’m trying it locally.
Here’s how to do it with downtime:
Update the local.system.replset doc on each server with the new replica set name. You have to change every server here.
Here is how to update local.system.replset in mongo shell: