File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,17 @@ mongodb21=`ping -c 1 ${MONGO21} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
1010mongodb22=` ping -c 1 ${MONGO22} | head -1 | cut -d " (" -f 2 | cut -d " )" -f 1`
1111mongodb23=` ping -c 1 ${MONGO23} | head -1 | cut -d " (" -f 2 | cut -d " )" -f 1`
1212
13-
1413port=${PORT:- 27017}
1514
16- echo setup.sh time now: ` date +" %T" `
15+ echo " Waiting for startup.."
16+ until mongo --host ${mongodb1} :${port} --eval ' quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' & > /dev/null; do
17+ printf ' .'
18+ sleep 1
19+ done
20+
21+ echo " Started.."
22+
23+ echo init-shard.sh time now: ` date +" %T" `
1724mongo --host ${mongodb1} :${port} << EOF
1825 sh.addShard( "${RS1} /${mongodb11} :${PORT1} ,${mongodb12} :${PORT2} ,${mongodb13} :${PORT3} " );
1926 sh.addShard( "${RS2} /${mongodb21} :${PORT1} ,${mongodb22} :${PORT2} ,${mongodb23} :${PORT3} " );
Original file line number Diff line number Diff line change @@ -6,7 +6,15 @@ mongodb3=`ping -c 1 ${MONGO3} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
66
77port=${PORT:- 27017}
88
9- echo setup.sh time now: ` date +" %T" `
9+ echo " Waiting for startup.."
10+ until mongo --host ${mongodb1} :${port} --eval ' quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' & > /dev/null; do
11+ printf ' .'
12+ sleep 1
13+ done
14+
15+ echo " Started.."
16+
17+ echo setup-cnf.sh time now: ` date +" %T" `
1018mongo --host ${mongodb1} :${port} << EOF
1119 var cfg = {
1220 "_id": "${RS} ",
Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ mongodb3=`ping -c 1 ${MONGO3} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
66
77port=${PORT:- 27017}
88
9+ echo " Waiting for startup.."
10+ until mongo --host ${mongodb1} :${port} --eval ' quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' & > /dev/null; do
11+ printf ' .'
12+ sleep 1
13+ done
14+
15+ echo " Started.."
16+
917echo setup.sh time now: ` date +" %T" `
1018mongo --host ${mongodb1} :${port} << EOF
1119 var cfg = {
You can’t perform that action at this time.
0 commit comments