library/roles/ELK/elasticsearch: Make the configuration files valid for both elasticsearch 2.x and 5.x.

This commit is contained in:
Andrea Dell'Amico 2017-03-06 18:37:33 +01:00
parent 9dd0afa884
commit 3a31d15cca
3 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,9 @@
---
elasticsearch_repo_key: https://packages.elastic.co/GPG-KEY-elasticsearch
elasticsearch_repo_version: 2.x
elasticsearch_major_version: 2
elasticsearch_repo_version: '{{ elasticsearch_major_version }}.x'
elasticsearch_repo: 'deb http://packages.elastic.co/elasticsearch/{{ elasticsearch_repo_version }}/debian stable main'
#elasticsearch_repo_version: 5.x
#elasticsearch_major_version: 5
#elasticsearch_repo: 'deb https://artifacts.elastic.co/packages/{{ elasticsearch_repo_version }}/apt stable main'
elasticsearch_packages:
- elasticsearch

View File

@ -17,6 +17,7 @@ LOG_DIR={{ elasticsearch_log_dir }}
# Elasticsearch PID directory
#PID_DIR=/var/run/elasticsearch
{% if elasticsearch_major_version <= 2 %}
# Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g
ES_HEAP_SIZE={{ elasticsearch_heap_size }}
# Heap new generation
@ -27,7 +28,7 @@ ES_HEAP_SIZE={{ elasticsearch_heap_size }}
# Additional Java OPTS
ES_JAVA_OPTS="{{ elasticsearch_additional_java_opts }}"
{% endif %}
# Configure restart on package upgrade (true, every other setting will lead to not restarting)
#ES_RESTART_ON_UPGRADE=true

View File

@ -36,6 +36,7 @@ path.data: {{ elasticsearch_data_dir }}
#
path.logs: {{ elasticsearch_log_dir }}
#
{% if elasticsearch_major_version <= 2 %}
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
@ -46,6 +47,7 @@ bootstrap.mlockall: true
# available on the system and that the owner of the process is allowed to use this limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
{% endif %}
#
# ---------------------------------- Network -----------------------------------
#