Can I configure a distributed environment system with mongodb? (For example, master and slave structures)

My job is to insert the data into the master and read the data, Slave nodes read data by dividing it, send it to the master node, It is a method to combine the data received from the slave nodes in the master node.

I have now set up the slave and master. (mongod --master, mongod --slave)

closed as unclear what you're asking by hot2use, mustaccio, Erik Darling, LowlyDBA, John Eisbrener Sep 19 '17 at 14:27

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Nowadays, master - slave system is not used anymore. You create replica set (RS) where you have one PRIMARY and at least one SECONDARY (plus arbiter), but minimum two SECONDARY are preferred.

In the RS, write is happening ALWAYS to current PRIMARY and preferred read is also from PRIMARY, but you can configure reading happening from SECONDARY too, but.. Information is not guaranteed to be up-to-date (until SECONDARY has replicated it OR write concern is so strict that OK is not returned until all nodes have it; what is not recommended).

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