Is it possible to configure only one secondary and one primary in MongoDB Replication?


Yes! Of course!
But in the situation where you lose one of the nodes (primary or secondary), remaining node state will be secondary and you cannot insert/update/delete data. If you can add (one) arbiter to that replica set, your DB will keep working even you lose one node. Basically arbiter don't need many resources, smallest VPS node what you can find is enough. (512MB memory, 1 CPU, 10GB diskspace) OR you can even add that arbiter to that application machine what is connecting to that mongoDB.

  • Thanks a lot, so practically it is possible but it has limitations/risky. I think it is better to add one more replica set/secondary to avoid risk, what do you say... – Sasi Apr 12 '20 at 8:11
  • Minimum recommended replica set is Primary and 2x Secondaries. But PSA (Primary, Secondary, Arbiter) setup is almost as good, as long as you keep physical/geographical distance between primary and secondary. Actually PSA is excellent IF all those nodes are at the different data centers. Because on that setup you can loose one (whole) data center and system still works. – JJussi Apr 12 '20 at 12:00
  • Agree with the PSA approach as the simplest and least resource intensive approach to reducing risk with your replicaset. MongoDB are trying to persuade clients to avoid using Arbiters now though. They won’t go away anytime soon, but not recommended. PSS is the minimum recommendation. This guidance was from both a consultant on site and their support team. – Clive Strong Apr 18 '20 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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