forked from wazuh/wazuh-docker
add debug to S3 repository creation in elasticsearch image
This commit is contained in:
@@ -76,15 +76,15 @@ function CreateRepo()
|
|||||||
repository="$repository_name-$version"
|
repository="$repository_name-$version"
|
||||||
s3_path="$path/$version"
|
s3_path="$path/$version"
|
||||||
|
|
||||||
curl ${auth} -X PUT "$elastic_ip_port/_snapshot/$repository" -H 'Content-Type: application/json' -d'
|
>&2 echo "Create S3 repository"
|
||||||
{
|
|
||||||
"type": "s3",
|
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
|
||||||
"settings": {
|
>&2 echo "Elastic is unavailable, S3 repository not created - sleeping"
|
||||||
"bucket": "'$bucket_name'",
|
sleep 5
|
||||||
"base_path": "'$s3_path'"
|
done
|
||||||
}
|
|
||||||
}
|
>&2 echo "S3 repository created"
|
||||||
'
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,13 +100,16 @@ done
|
|||||||
if [ $ENABLE_CONFIGURE_S3 ]; then
|
if [ $ENABLE_CONFIGURE_S3 ]; then
|
||||||
#Wait for Elasticsearch to be ready to create the repository
|
#Wait for Elasticsearch to be ready to create the repository
|
||||||
sleep 10
|
sleep 10
|
||||||
|
>&2 echo "Configure S3"
|
||||||
if [ "x$S3_PATH" != "x" ]; then
|
if [ "x$S3_PATH" != "x" ]; then
|
||||||
|
>&2 echo "S3_PATH"
|
||||||
|
>&2 echo $S3_PATH
|
||||||
if [ "x$S3_ELASTIC_MAJOR" != "x" ]; then
|
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
|
bash /usr/share/elasticsearch/config/configure_s3.sh $el_url $S3_BUCKET_NAME $S3_PATH $S3_REPOSITORY_NAME $S3_ELASTIC_MAJOR
|
||||||
|
|
||||||
else
|
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
|
bash /usr/share/elasticsearch/config/configure_s3.sh $el_url $S3_BUCKET_NAME $S3_PATH $S3_REPOSITORY_NAME
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user