1

I have 5 old servers, each with single socket CPU, 4 physical cores(8 logical) and 128GB of RAM. I am getting started with mongoDB and plan to deploy MongoDB 4.2.2 on my 5 servers for a lab environment. I installed Virtual Box on each one, and plan to have a high-available installation of MongoDB. After a lot of reading I came up with a design and I'd like to get an opinion on my setup, particularly the shard and replica portion of the cluster.

I have the following:

  • 5 Physical servers(denoted as P1 through P5) each with Virtual Box installed. All the VMs are running Ubuntu 16 Server edition guest OS.
  • 3 Config servers sitting on 3 different VMs on 3 different physical servers. Each config server is allocated 1CPU and 4GB of RAM. Let's call these Conf1_P1 (Config server 1 is sitting on Physical server P1), Conf2_P2, Conf3_P3
  • 2 mongos routers sitting on 2 different VMS on 2 different physical servers. Each Router is allocated 2CPUs and 8GB RAM. Let's call these Router1_P4 and Router2_P5
  • 5 Arbiters sitting on 5 different VMs on 5 different physical servers. Each arbiter is allocated 1 CPU and 2GB of Ram. Let's call these Ar1_P2(Arbiter server 1 is sitting on Physical server P2), AR2_P3, AR3_P4, AR4_P5, AR5_P1
  • 5 shards sitting on 5 different VMs on 5 different physical servers:
    • 3 shards are allocated 2 CPUs, and 8GB of RAM. Let's call these SH1_P1, SH2_P2, SH3_P3.
    • 2 Shards are allocated 1 CPU and 8GB RAM. Let's call these SH4_P4, SH5_P5. These are allocated 1 CPU because the physical server these VMS are sitting on only has 4 physical core, and 2 are already assigned to run Mongo Router.
  • 5 replica members: 1 replica/shard on 5 different VMs, each is assigned 1 CPU and 8GB RAM. Let's call these REP_SH1_P2(the replica for shard 1 is sitting on physical server P2), REP_SH2_P3, REP_SH3_P4, REP_SH4_P5, REP_SH5_P1
  • 1 replica set for the 3 config servers
  • 5 replica set, each with 2 members and 1 arbiter:
    • ReplSet1: SH1_P1, REP_SH1_P2, Ar1_P2
    • ReplSet2: SH2_P2, REP_SH2_P3, Ar2_P3
    • ReplSet3: SH3_P3, REP_SH3_P4, Ar3_P4
    • ReplSet4: SH4_P4, REP_SH4_P5, Ar4_P5
    • ReplSet5: SH5_P5, REP_SH5_P1, Ar5_P1

The summary for each physical server's resources usage is as follow enter image description here

I decided to go with 5 shards to maximize parallelism (horizontal scaling). The choice to have only 2 members in a replica set is due to disk space constrain. What are your thoughts on this particular design? Any concern I should be aware of?

0

From comments:

  1. mongoS doesn't need much memory/CPU (or even its own machine) and can be located (installed) on the config servers.
  2. config servers don't need that much memory, even when mongoS is there; 1-2GB is enough.

JJussi

| improve this answer | |

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.