Skip to content

Commit 65bfd22

Browse files
committed
Merge branch 'hotfix/10-missing-ping'
2 parents c073ca2 + 8af0b2b commit 65bfd22

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

scripts/init-shard.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
#!/bin/bash
22

3-
mongodb1=`ping -c 1 ${MONGOS} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
3+
mongodb1=`getent hosts ${MONGOS} | awk '{ print $1 }'`
44

5-
mongodb11=`ping -c 1 ${MONGO11} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
6-
mongodb12=`ping -c 1 ${MONGO12} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
7-
mongodb13=`ping -c 1 ${MONGO13} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
5+
mongodb11=`getent hosts ${MONGO11} | awk '{ print $1 }'`
6+
mongodb12=`getent hosts ${MONGO12} | awk '{ print $1 }'`
7+
mongodb13=`getent hosts ${MONGO13} | awk '{ print $1 }'`
88

9-
mongodb21=`ping -c 1 ${MONGO21} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
10-
mongodb22=`ping -c 1 ${MONGO22} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
11-
mongodb23=`ping -c 1 ${MONGO23} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
9+
mongodb21=`getent hosts ${MONGO21} | awk '{ print $1 }'`
10+
mongodb22=`getent hosts ${MONGO22} | awk '{ print $1 }'`
11+
mongodb23=`getent hosts ${MONGO23} | awk '{ print $1 }'`
12+
13+
mongodb31=`getent hosts ${MONGO31} | awk '{ print $1 }'`
14+
mongodb32=`getent hosts ${MONGO32} | awk '{ print $1 }'`
15+
mongodb33=`getent hosts ${MONGO33} | awk '{ print $1 }'`
1216

1317
port=${PORT:-27017}
1418

scripts/setup-cnf.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
mongodb1=`ping -c 1 ${MONGO1} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
4-
mongodb2=`ping -c 1 ${MONGO2} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
5-
mongodb3=`ping -c 1 ${MONGO3} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
3+
mongodb1=`getent hosts ${MONGO1} | awk '{ print $1 }'`
4+
mongodb2=`getent hosts ${MONGO2} | awk '{ print $1 }'`
5+
mongodb3=`getent hosts ${MONGO3} | awk '{ print $1 }'`
66

77
port=${PORT:-27017}
88

scripts/setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
mongodb1=`ping -c 1 ${MONGO1} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
4-
mongodb2=`ping -c 1 ${MONGO2} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
5-
mongodb3=`ping -c 1 ${MONGO3} | head -1 | cut -d "(" -f 2 | cut -d ")" -f 1`
3+
mongodb1=`getent hosts ${MONGO1} | awk '{ print $1 }'`
4+
mongodb2=`getent hosts ${MONGO2} | awk '{ print $1 }'`
5+
mongodb3=`getent hosts ${MONGO3} | awk '{ print $1 }'`
66

77
port=${PORT:-27017}
88

0 commit comments

Comments
 (0)