Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a mongodb replica set and want to move it to a single server setup

Is it just as simple as doing a rs.remove() to the other 2 nodes?

share|improve this question
add comment

2 Answers

On the current primary node of the replica set, you may issue the rs.remove() for those nodes, and thereby stopping replication attempts to them.

You will probably have to shut down the server that you want to run in single mode, and start it up again without the --replSet <name> option (or whatever it might be set to in your config file), as this will start the server in single mode, and not try to replicate to any other nodes.

share|improve this answer
add comment

You can skip the remove altogether and in fact you should. To explain: if you rs.remove() one at a time, then after the first remove you will end up without enough votes to form a majority (impossible to have a majority with 2 nodes).

So, as Mike suggested, just restart the primary without --replSet (or the config file equivalent) and shut down the other nodes.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.