|
|
@ -21,11 +21,22 @@ register 'elastic' 'status' 'HTTP status code of the elasticsearch service' elas |
|
|
|
|
|
|
|
|
|
|
|
function elastic_wait(){ |
|
|
|
function elastic_wait(){ |
|
|
|
echo 'waiting for elasticsearch service to come up'; |
|
|
|
echo 'waiting for elasticsearch service to come up'; |
|
|
|
until test $(elastic_status) -eq 200; do |
|
|
|
retry_count=30 |
|
|
|
printf '.' |
|
|
|
|
|
|
|
|
|
|
|
i=1 |
|
|
|
|
|
|
|
while [[ "$i" -le "$retry_count" ]]; do |
|
|
|
|
|
|
|
if [[ $(elastic_status) -eq 200 ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
exit 0 |
|
|
|
|
|
|
|
fi |
|
|
|
sleep 2 |
|
|
|
sleep 2 |
|
|
|
|
|
|
|
printf "." |
|
|
|
|
|
|
|
i=$(($i + 1)) |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
echo "Elasticsearch did not come up, check configuration" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
register 'elastic' 'wait' 'wait for elasticsearch to start up' elastic_wait |
|
|
|
register 'elastic' 'wait' 'wait for elasticsearch to start up' elastic_wait |
|
|
|