When I want to move a single mongodb server into a sharded cluster, I know that I need 3 config servers. Since we have evertything on one single EXSi server I just want to ask if it is the preferred way is really to setup 3 small config server VM's and two additional VM's for the mongod servers. Does this make sense since the the OS on the config server alone will consume 300MB ram (or so)? Is it a good idea to use one VM and three docker containers for the config servers instead? And should I install the mongos router(s) on the two data nodes or on the server where the config servers are living? Let me sum up the question how many VM's do I realy need as a minimum for a sharded mongo cluster?

Or is Ubuntu Snappy Core an option?

1 Answer 1


If you are setting up a lab environment you can save on resources usage as much as you like. The idea of using containers/docker sounds reasonable for a lab environment (and even for a prod one provided you distribute containers among different physical hosts).

The minimum number of mongod processes for a sharded environment is 9. 3 for the configuration replica set, and 3 for each of the (minimum of) 2 replicasets in the shard.

"Distributed" means it can be run in different machines, but it's not compulsory. You could be running all the 9 mongod processes on a single physical host using different ports ...

As for the mongos router processes they should run as close to the client apps as possible; i.e. put one mongos on each VM with an application that uses mongo.

Closing remark. Please note the emphasys on lab environment. If you are building something other than a learning environment using a single ESXi node I'd say you need to examine your assumptions.

  • I have putted the mongos and mongoc services on the same machines since they do not have lots of I/O. So I have now 5 productive servers (VM's) 3 mongos + mongoc and two shards. I thought about making 3 shards and also put the replica sets onto the mongos and mongoc VMs so I would have 6 VMs. But I am also thinking of just adding 2 more VMs for the replica sets so I would have 7 VMs. And yes the VMs are currently on the same metal, but I will be prepared for simply moving single VM from one metal to another when needed. The setup is semi productive since the app development is not finished yet
    – KIC
    Jul 9, 2015 at 8:09

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.