From bc15d35d74def3c427c92a8f5ac6f1f7c1612840 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Wed, 27 Apr 2022 10:24:16 +0000 Subject: [PATCH] 7.17.3-debian-10-r5 release --- .../opt/bitnami/scripts/libelasticsearch.sh | 81 +++++++------------ bitnami/elasticsearch/README.md | 2 +- 2 files changed, 32 insertions(+), 51 deletions(-) diff --git a/bitnami/elasticsearch/7/debian-10/rootfs/opt/bitnami/scripts/libelasticsearch.sh b/bitnami/elasticsearch/7/debian-10/rootfs/opt/bitnami/scripts/libelasticsearch.sh index 2d6cd3a69b55..f5f191218337 100644 --- a/bitnami/elasticsearch/7/debian-10/rootfs/opt/bitnami/scripts/libelasticsearch.sh +++ b/bitnami/elasticsearch/7/debian-10/rootfs/opt/bitnami/scripts/libelasticsearch.sh @@ -250,6 +250,14 @@ elasticsearch_validate() { done } + # Temporary fix until ELASTICSEARCH_NODE_TYPE is removed to ensure the correct permissions to run 'elasticsearch --version' + debug "Ensuring expected directories/files exist..." + am_i_root && ensure_user_exists "$ELASTICSEARCH_DAEMON_USER" --group "$ELASTICSEARCH_DAEMON_GROUP" + for dir in "$ELASTICSEARCH_TMP_DIR" "$ELASTICSEARCH_LOGS_DIR" "$ELASTICSEARCH_PLUGINS_DIR" "$ELASTICSEARCH_BASE_DIR/modules" "$ELASTICSEARCH_CONF_DIR"; do + ensure_dir_exists "$dir" + am_i_root && chown -R "$ELASTICSEARCH_DAEMON_USER:$ELASTICSEARCH_DAEMON_GROUP" "$dir" + done + es_version="$(elasticsearch_get_version)" es_major_version="$(get_sematic_version "$es_version" 1)" @@ -574,13 +582,10 @@ elasticsearch_configure_node_roles() { # None ######################### elasticsearch_set_heap_size() { - local heap_size es_version es_major_version es_minor_version + local heap_size # Remove heap.options if it already exists rm -f "${ELASTICSEARCH_CONF_DIR}/jvm.options.d/heap.options" - es_version="$(elasticsearch_get_version)" - es_major_version="$(get_sematic_version "$es_version" 1)" - es_minor_version="$(get_sematic_version "$es_version" 2)" if [[ -n "$ELASTICSEARCH_HEAP_SIZE" ]]; then debug "Using specified values for Xmx and Xms heap options..." @@ -609,29 +614,15 @@ elasticsearch_set_heap_size() { heap_size=32768m fi fi - debug "Setting '-Xmx${heap_size} -Xms${heap_size}' heap options..." - # Elasticsearch > 7.10 encourages to customize the heap settings through a file in 'jvm.options.d' - # Previous versions need to update the 'jvm.options' file - if [[ "$es_major_version" -ge 8 ]] || [[ "$es_major_version" -ge 7 && "$es_minor_version" -gt 10 ]]; then - debug "Setting Xmx and Xms options in heap.options file" - cat >"${ELASTICSEARCH_CONF_DIR}/jvm.options.d/heap.options" <"${ELASTICSEARCH_CONF_DIR}/jvm.options.d/heap.options" <