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)?

2
  • 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
    Commented Oct 7, 2015 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
    Commented Oct 7, 2015 at 20:05

1 Answer 1

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.

1
  • 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
    Commented May 13, 2016 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .