We currently have 5 mongodb micro instances on aws, each of them serve different modules and the calls are made through REST services.
We are planning to setup replication for these instances and my question would be, is it possible to setup replication for all these instances in a single instance?
The data is pretty small in these instances, so i do not want to have primary and secondary for each one them.
Thanks in advance.
Best Answer
You have 5 servers serv1,serv2,serv3,serv4,serv5 and you want to set up 5 instanses inst1,inst2,inst3,inst4,inst5. Each instance should have at least 2 data nodes (PRIMARY and SECONDARY) and 1 ARBITER
serv1: inst1_PRI, inst5_SEC, inst4_ARB
serv2: inst2_PRI, inst1_SEC, inst5_ARB
serv3: inst3_PRI, inst2_SEC, inst1_ARB
serv4: inst4_PRI, inst3_SEC, inst2_ARB
serv5: inst5_PRI, inst4_SEC, inst3_ARB
This architecture provide fault tolerance of 1. If one server goes down all instances are continue to work. If you loose 2 servers one instance should be affected ...