From 22256118ea810940d4ff4a32bb444edf6842baea Mon Sep 17 00:00:00 2001 From: root Apostolos Date: Sat, 20 Jul 2019 00:56:05 +0300 Subject: [PATCH] howto replica --- create-replica | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 create-replica diff --git a/create-replica b/create-replica new file mode 100644 index 0000000..daea878 --- /dev/null +++ b/create-replica @@ -0,0 +1,12 @@ +# connect to PRIMARY +mongo +> rs.initiate() +> rs.status() +> rs.add("mongo_node2") +> rs.add("mongo_node3") +> rs.status() +> rs.isMaster() + +#You now have a working MongoDB replication. +#You can increase the cluster size from *three* nodes to *five* nodes, *seven* nodes or more. +#This number is calculated from: [Master Eligible Nodes) / 2 + 1], which means an odd number of nodes is required for high availability, the minimum number is *three*.