How to reset MongoDB replica set settings

mongodb

I want to start over the configurations of replica, is it possible? How to reset it?

In group people saying to remove the database content, but are there any work around?

Best Answer

If you want to keep the data, but start outside a replica set, just restart the mongod process without the --replSet and on a different port. That will give you a standalone mongod.

To be completely sure that the replica set configuration is gone from the instance, make sure that the local.system.replset collection is empty.

Once that is done, and you are happy with your standalone instance, you can then restart with a different --replSet argument and go through the replica set configuration process again:

http://www.mongodb.org/display/DOCS/Replica+Set+Configuration

The other option, as you mention, is to remove all the data files and start completely from scratch.

Related Topic