add debug to S3 repository creation in elasticsearch image

Former-commit-id: 0c571ad3f9
This commit is contained in:
AlfonsoRBJ
2019-09-03 11:15:35 +02:00
parent 71933d6625
commit 610f6f49ce
2 changed files with 15 additions and 12 deletions

View File

@@ -76,15 +76,15 @@ function CreateRepo()
repository="$repository_name-$version"
s3_path="$path/$version"
curl ${auth} -X PUT "$elastic_ip_port/_snapshot/$repository" -H 'Content-Type: application/json' -d'
{
"type": "s3",
"settings": {
"bucket": "'$bucket_name'",
"base_path": "'$s3_path'"
}
}
'
>&2 echo "Create S3 repository"
until curl ${auth} -X PUT "$elastic_ip_port/_snapshot/$repository" -H 'Content-Type: application/json' -d' {"type": "s3", "settings": { "bucket": "'$bucket_name'", "base_path": "'$s3_path'"} }'; do
>&2 echo "Elastic is unavailable, S3 repository not created - sleeping"
sleep 5
done
>&2 echo "S3 repository created"
}

View File

@@ -100,13 +100,16 @@ done
if [ $ENABLE_CONFIGURE_S3 ]; then
#Wait for Elasticsearch to be ready to create the repository
sleep 10
>&2 echo "Configure S3"
if [ "x$S3_PATH" != "x" ]; then
>&2 echo "S3_PATH"
>&2 echo $S3_PATH
if [ "x$S3_ELASTIC_MAJOR" != "x" ]; then
>&2 echo "Elasticsearch major version:"
>&2 echo $S3_ELASTIC_MAJOR
bash /usr/share/elasticsearch/config/configure_s3.sh $el_url $S3_BUCKET_NAME $S3_PATH $S3_REPOSITORY_NAME $S3_ELASTIC_MAJOR
else
>&2 echo "Elasticserach major version not given"
bash /usr/share/elasticsearch/config/configure_s3.sh $el_url $S3_BUCKET_NAME $S3_PATH $S3_REPOSITORY_NAME
fi