diff --git a/defaults/main.yml b/defaults/main.yml index 07ecfc8..6f05a75 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -49,6 +49,7 @@ es_debian_startup_timeout: 10 # JVM custom parameters es_java_home: '' es_jvm_custom_parameters: '' +es_heap_dump_path: "/var/lib/elasticsearch" # SSL/TLS parameters es_enable_auto_ssl_configuration: true diff --git a/templates/jvm.options.j2 b/templates/jvm.options.j2 index 544e4ee..3acf398 100644 --- a/templates/jvm.options.j2 +++ b/templates/jvm.options.j2 @@ -37,12 +37,19 @@ ################################################################ ## GC configuration +{% if es_version is version('7.6.0', '<') %} -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly +{% else %} +8-13:-XX:+UseConcMarkSweepGC +8-13:-XX:CMSInitiatingOccupancyFraction=75 +8-13:-XX:+UseCMSInitiatingOccupancyOnly +{% endif %} ## G1GC Configuration -# NOTE: G1GC is only supported on JDK version 10 or later. +# NOTE: G1 GC is only supported on JDK version 10 or later +{% if es_version is version('7.6.0', '<') %} # To use G1GC uncomment the lines below. # 10-:-XX:-UseConcMarkSweepGC # 10-:-XX:-UseCMSInitiatingOccupancyOnly @@ -53,6 +60,15 @@ # 10-:-XX:G1ReservePercent=25 # 10-:-XX:InitiatingHeapOccupancyPercent=30 {% endif %} +{% else %} +# to use G1GC, uncomment the next two lines and update the version on the +# following three lines to your version of the JDK +# 10-13:-XX:-UseConcMarkSweepGC +# 10-13:-XX:-UseCMSInitiatingOccupancyOnly +14-:-XX:+UseG1GC +14-:-XX:G1ReservePercent=25 +14-:-XX:InitiatingHeapOccupancyPercent=30 +{% endif %} {% if es_version is version('7.5.0', '<') %} ## DNS cache policy @@ -100,6 +116,7 @@ -Dlog4j2.disable.jmx=true {% endif %} +## JVM temporary directory -Djava.io.tmpdir=${ES_TMPDIR} ## heap dumps @@ -110,7 +127,7 @@ # specify an alternative path for heap dumps; ensure the directory exists and # has sufficient space --XX:HeapDumpPath=${heap.dump.path} +-XX:HeapDumpPath={{ es_heap_dump_path }} # specify an alternative path for JVM fatal error logs -XX:ErrorFile={{ es_log_dir }}/hs_err_pid%p.log