12

On the mongoDB documentation for a production cluster architecture I read that the minimum amount of servers for a running production mongoDB cluster is 7:

mongoDB cluster architecture

Is it possible to share the routers, config servers and shards on the same servers (having 3 total servers each with a router, config and shard service)?

Mat
  • 1,783
  • 4
  • 22
  • 39
  • 1
    IIRC, you can run the shard and config on the same instances, and the router runs on your existing app servers, so you really can have a safe production cluster on three servers. – ceejayoz Oct 07 '15 at 19:39
  • Thank you very much! I'm using a load balancer to balance and failover my clusters, will I be able to use it for my mongoDB cluster too? I will need a three nodes cluster fully replicated on all three nodes, so one shard on three master nodes (all nodes have to accept queries and updates). Would it be possible? – Mat Oct 07 '15 at 20:05

1 Answers1

14

The minimum number is 1 server. If by "production" you mean "fault tolerant" then the minimum number is 3: you have a replica set containing 3 servers. The config servers also run on these servers. If you want to include "horizontal scaling" i.e. "web scale!" as well then the minimum number is 9: you have 2 shards consisting of replica sets of 3 servers and 3 more servers as config servers. If you include your app, not just mongodb, then add your two app servers to the mix for a total of 11 (it goes to 11!).

Basically you are interpreting that picture incorrectly in two ways: your app servers are not part of a mongodb cluster and the shards (green boxes) are replica sets, which contain at least 3 servers.

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47
  • Hi Mark, I'm coming back on this argument because I have a question about: I mean a fault tolerant MongoDB cluster. I understand that 9 servers are required if I want MongoDB to work as load balancer too, but what if I create three replica sets and use HAProxy as load balancer, like I'm doing on MariaDB with Galera? – Mat May 13 '16 at 08:22