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:
Maarten Bezemer 2016-11-21 11:31:25 +01:00
parent 65238c74bd
commit 8f989c41a7
2 changed files with 6 additions and 0 deletions

View file

@ -51,9 +51,11 @@ ES_GROUP={{es_group}}
# Directory where the Elasticsearch binary distribution resides # Directory where the Elasticsearch binary distribution resides
ES_HOME={{es_home}} ES_HOME={{es_home}}
{% if es_version | version_compare('5.0', '<') %}
# Heap size defaults to 256m min, 1g max # Heap size defaults to 256m min, 1g max
# Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g # Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g
#ES_HEAP_SIZE=2g #ES_HEAP_SIZE=2g
{% endif %}
# Heap new generation # Heap new generation
#ES_HEAP_NEWSIZE= #ES_HEAP_NEWSIZE=
@ -137,10 +139,12 @@ case "$1" in
start) start)
checkJava checkJava
{% if es_version | version_compare('5.0', '<') %}
if [ -n "$MAX_LOCKED_MEMORY" -a -z "$ES_HEAP_SIZE" ]; then 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" log_failure_msg "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set"
exit 1 exit 1
fi fi
{% endif %}
log_daemon_msg "Starting $DESC" log_daemon_msg "Starting $DESC"

View file

@ -90,10 +90,12 @@ checkJava() {
start() { start() {
checkJava checkJava
[ -x $exec ] || exit 5 [ -x $exec ] || exit 5
{% if es_version | version_compare('5.0', '<') %}
if [ -n "$MAX_LOCKED_MEMORY" -a -z "$ES_HEAP_SIZE" ]; then if [ -n "$MAX_LOCKED_MEMORY" -a -z "$ES_HEAP_SIZE" ]; then
echo "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set" echo "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set"
return 7 return 7
fi fi
{% endif %}
if [ -n "$MAX_OPEN_FILES" ]; then if [ -n "$MAX_OPEN_FILES" ]; then
ulimit -n $MAX_OPEN_FILES ulimit -n $MAX_OPEN_FILES
fi fi