From 3c8b7d15c4fd6e826de4a1eba4eb6d02d42b9da2 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 10 Feb 2017 12:37:04 +0000 Subject: [PATCH 1/3] Adding 4th member for arbiter --- build_procceses.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_procceses.sh b/build_procceses.sh index 20da795..6fe4845 100755 --- a/build_procceses.sh +++ b/build_procceses.sh @@ -2,18 +2,18 @@ #Build the main data folders mkdir -p $mongo_dbpath_root cd $mongo_dbpath_root -mkdir -p {r1-1,r1-2,r1-3,r2-1,r2-2,r2-3,c1,c2,c3,m1}/data +mkdir -p {r1-1,r1-2,r1-3,rs1-4,r2-1,r2-2,r2-3,rs2-4,c1,c2,c3,m1}/data cd "$start_dir" #Start the processes #replSet1 -for i in `seq 1 3`;do +for i in `seq 1 4`;do $bin_dir/mongod --fork --logpath $mongo_dbpath_root/r1-${i}/mongo.log --dbpath $mongo_dbpath_root/r1-${i} --port 1700${i} --replSet r1 --shardsvr --nohttpinterface done #replSet2 -for i in `seq 1 3`;do +for i in `seq 1 4`;do $bin_dir/mongod --fork --logpath $mongo_dbpath_root/r2-${i}/mongo.log --dbpath $mongo_dbpath_root/r2-${i} --port 1800${i} --replSet r2 --shardsvr --nohttpinterface done From 7a6ec96dbef77f1cd58cb18a89ee5e30c7ced5c1 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 10 Feb 2017 12:49:00 +0000 Subject: [PATCH 2/3] add arbiter to replset --- config_replset.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config_replset.js b/config_replset.js index 5710fef..a9676d1 100644 --- a/config_replset.js +++ b/config_replset.js @@ -2,6 +2,7 @@ port=parseInt(db.adminCommand("getCmdLineOpts").parsed.net.port) port2=port+1; port3=port+2; + port4=port+3 conf = { _id : replSet, @@ -9,6 +10,7 @@ { _id:0 , host:"localhost:"+port,priority:10}, { _id:1 , host:"localhost:"+port2}, { _id:2 , host:"localhost:"+port3}, + { _id:3 , host:"localhost:"+port4, arbiterOnly:true}, ] }; From b72a2f30e1239e26a149f7ce974a668fc6d6cce4 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 10 Feb 2017 14:18:39 +0000 Subject: [PATCH 3/3] Fixed bad naming on rs{1,2}-4 to r{1,2}-4 --- build_procceses.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_procceses.sh b/build_procceses.sh index 6fe4845..5904627 100755 --- a/build_procceses.sh +++ b/build_procceses.sh @@ -2,7 +2,7 @@ #Build the main data folders mkdir -p $mongo_dbpath_root cd $mongo_dbpath_root -mkdir -p {r1-1,r1-2,r1-3,rs1-4,r2-1,r2-2,r2-3,rs2-4,c1,c2,c3,m1}/data +mkdir -p {r1-1,r1-2,r1-3,r1-4,r2-1,r2-2,r2-3,r2-4,c1,c2,c3,m1}/data cd "$start_dir" #Start the processes @@ -45,5 +45,5 @@ $bin_dir/mongo --quiet --eval "printjson(db.getSisterDB('admin').runCommand({add echo -e "Service\t\tPortRange" echo -e "Mongos\t\t27017" echo -e "Config\t\t19001-19003" -echo -e "Shard1\t\t17001-17003" -echo -e "Shard2\t\t18001-18003" +echo -e "Shard1\t\t17001-17004" +echo -e "Shard2\t\t18001-18004"