mirror of https://github.com/interlegis/sapl.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
663 B
25 lines
663 B
5 years ago
|
#!/usr/bin/env bash
|
||
6 years ago
|
|
||
6 years ago
|
# Pass the base SOLR URL as parameter, i.e., bash check_solr http://localhost:8983
|
||
|
|
||
|
SOLR_URL=$1
|
||
|
|
||
6 years ago
|
RETRY_COUNT=1
|
||
|
RETRY_LIMIT=4
|
||
|
|
||
6 years ago
|
echo "Waiting for solr connection at $SOLR_URL ..."
|
||
6 years ago
|
while [[ $RETRY_COUNT < $RETRY_LIMIT ]]; do
|
||
|
echo "Attempt to connect to solr: $RETRY_COUNT of $RETRY_LIMIT"
|
||
|
let RETRY_COUNT=RETRY_COUNT+1;
|
||
6 years ago
|
echo "$SOLR_URL/solr/admin/collections?action=LIST"
|
||
|
RESULT=$(curl -s -o /dev/null -I "$SOLR_URL/solr/admin/collections?action=LIST" -w '%{http_code}')
|
||
|
echo $RESULT
|
||
6 years ago
|
if [ $RESULT == 200 ]; then
|
||
6 years ago
|
echo "Solr server is up!"
|
||
6 years ago
|
exit 1
|
||
6 years ago
|
else
|
||
|
sleep 3
|
||
|
fi
|
||
|
done
|
||
6 years ago
|
echo "Solr connection failed."
|
||
|
exit 2
|