mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-23 04:51:57 +00:00
add debug to S3 repository creation in elasticsearch image
Former-commit-id: 0c571ad3f9
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user