Search code examples
mongodbdistributeddatabasenosql

mongodb shards, how many mongod for this case


In mongodb. If you want to build a production system with two shards, each one a replica set with three nodes, how may mongod processes must you start?

why the answer is 9?


Solution

  • Because you need 3 replicas per shard x the 2 shards + 3 config servers to run the sharded cluster = 9 mongods. The config servers, although also mongod processes, aren't data carrying nodes. You must have 3 config servers though, to guarantee redundancy among the config server nodes.

    http://docs.mongodb.org/manual/core/sharded-cluster-architectures-production/