mirror of
https://github.com/aljazceru/ansible-elasticsearch.git
synced 2025-12-18 17:44:20 +01:00
Disable check if ES_HEAP_SIZE exists for ES 5.x
ES_HEAP_SIZE is not used for ES5.x anymore, instead ES_JAVA_OPTS 'Xms' and 'Xmx' are used
This commit is contained in:
@@ -51,9 +51,11 @@ ES_GROUP={{es_group}}
|
||||
# Directory where the Elasticsearch binary distribution resides
|
||||
ES_HOME={{es_home}}
|
||||
|
||||
{% if es_version | version_compare('5.0', '<') %}
|
||||
# Heap size defaults to 256m min, 1g max
|
||||
# Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g
|
||||
#ES_HEAP_SIZE=2g
|
||||
{% endif %}
|
||||
|
||||
# Heap new generation
|
||||
#ES_HEAP_NEWSIZE=
|
||||
@@ -137,10 +139,12 @@ case "$1" in
|
||||
start)
|
||||
checkJava
|
||||
|
||||
{% if es_version | version_compare('5.0', '<') %}
|
||||
if [ -n "$MAX_LOCKED_MEMORY" -a -z "$ES_HEAP_SIZE" ]; then
|
||||
log_failure_msg "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set"
|
||||
exit 1
|
||||
fi
|
||||
{% endif %}
|
||||
|
||||
log_daemon_msg "Starting $DESC"
|
||||
|
||||
|
||||
@@ -90,10 +90,12 @@ checkJava() {
|
||||
start() {
|
||||
checkJava
|
||||
[ -x $exec ] || exit 5
|
||||
{% if es_version | version_compare('5.0', '<') %}
|
||||
if [ -n "$MAX_LOCKED_MEMORY" -a -z "$ES_HEAP_SIZE" ]; then
|
||||
echo "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set"
|
||||
return 7
|
||||
fi
|
||||
{% endif %}
|
||||
if [ -n "$MAX_OPEN_FILES" ]; then
|
||||
ulimit -n $MAX_OPEN_FILES
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user