File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ function zkConfig() {
1919function zkConnectionString() {
2020 # If the client service address is not yet available, then return localhost
2121 set +e
22- nslookup " ${CLIENT_HOST} " 2> /dev/null 1> /dev/null
23- if [[ $? -eq 1 ]]; then
22+ getent hosts " ${CLIENT_HOST} " 2> /dev/null 1> /dev/null
23+ if [[ $? -ne 0 ]]; then
2424 set -e
2525 echo " localhost:${CLIENT_PORT} "
2626 else
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ OK=$(echo ruok | nc 127.0.0.1 $CLIENT_PORT)
2525# Check to see if zookeeper service answers
2626if [[ " $OK " == " imok" ]]; then
2727 set +e
28- nslookup $DOMAIN
29- if [[ $? -eq 1 ]]; then
28+ getent hosts $DOMAIN
29+ if [[ $? -ne 0 ]]; then
3030 set -e
3131 echo " There is no active ensemble, skipping readiness probe..."
3232 exit 0
Original file line number Diff line number Diff line change @@ -69,20 +69,20 @@ if [[ -n "$ENVOY_SIDECAR_STATUS" ]]; then
6969fi
7070set -e
7171
72- # Determine if there is a ensemble available to join by checking the service domain
72+ # Determine if there is an ensemble available to join by checking the service domain
7373set +e
74- nslookup $DOMAIN
75- if [[ $? -eq 1 ]]; then
76- # If an nslookup of the headless service domain fails, then there is no
77- # active ensemble yet, but in certain cases nslookup of headless service
74+ getent hosts $DOMAIN # This only performs a dns lookup
75+ if [[ $? -ne 0 ]]; then
76+ # If dns lookup of the headless service domain fails, then there is no
77+ # active ensemble yet, but in certain cases the dns lookup of headless service
7878 # takes a while to come up even if there is active ensemble
7979 ACTIVE_ENSEMBLE=false
8080 declare -i count=20
8181 while [[ $count -ge 0 && $MYID -ne 1 ]]
8282 do
8383 sleep 2
8484 (( count= count- 1 ))
85- nslookup $DOMAIN
85+ getent hosts $DOMAIN
8686 if [[ $? -eq 0 ]]; then
8787 ACTIVE_ENSEMBLE=true
8888 break
You can’t perform that action at this time.
0 commit comments