Search code examples
mongodbreplicasetconfigserver

Getting "replica set IDs do not match, ours:<>,remote node‘s: <>" while trying to run replicaset of config servers


I am trying to create a sharded collections. For that I created of replica set of config server. But I faced some problem doing that to I deleted the replica set from "local.system.replset". Changed replset name in the config files for the config servers. Then after creating replset with new name but old ips.I am getting the following error:

 "replica set IDs do not match, ours:<new replset name>,remote node‘s: <old replset name>"

So it seems that somewhere the binding still exists for the old replset name. How can I remove it? Or changing the ips of the config servers is the only option?


Solution

  • One way will be to pick one node that has the current data, remove its replica set configuration document and start it with the new name.

    Then make a backup (just in case) and delete all of the files in the dbpath of the other nodes, start them with the new name in the configuration file, and rs.add them to the replica set.

    The nodes that had been cleared will copy all of the data from the first.