Is there a way to configure a distributed environment with mongodb?
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).