library/roles/ELK/elasticsearch: Better defaults. Fix the heap size configuration for the 2.x elasticsearch versions.

This commit is contained in:
Andrea Dell'Amico 2017-02-23 22:21:46 +01:00
parent fe62f677a0
commit 62b9b9582d
3 changed files with 11 additions and 16 deletions

View File

@ -1,8 +1,9 @@
---
elasticsearch_repo_key: https://packages.elastic.co/GPG-KEY-elasticsearch
elasticsearch_repo_version: 5.x
#elasticsearch_repo: 'deb http://packages.elastic.co/elasticsearch/{{ elasticsearch_repo_version }}/debian stable main'
elasticsearch_repo: 'deb https://artifacts.elastic.co/packages/{{ elasticsearch_repo_version }}/apt stable main'
elasticsearch_repo_version: 2.x
elasticsearch_repo: 'deb http://packages.elastic.co/elasticsearch/{{ elasticsearch_repo_version }}/debian stable main'
#elasticsearch_repo_version: 5.x
#elasticsearch_repo: 'deb https://artifacts.elastic.co/packages/{{ elasticsearch_repo_version }}/apt stable main'
elasticsearch_packages:
- elasticsearch
@ -12,7 +13,7 @@ elasticsearch_enabled: True
elasticsearch_http_port: 9200
elasticsearch_data_dir: /var/lib/elasticsearch
elasticsearch_log_dir: /var/log/elasticsearch
elasticsearch_bind_ip: 127.0.0.1
elasticsearch_bind_ip: 0.0.0.0
elasticsearch_discovery_host_list: '["127.0.0.1", "[::1]"]'
elasticsearch_define_majority_of_nodes: True
elasticsearch_majority_of_nodes: 1
@ -22,15 +23,16 @@ elasticsearch_max_local_storage_nodes: 1
elasticsearch_destructive_requires_name: 'true'
elasticsearch_define_heap_size: False
elasticsearch_heap_size: 2g
elasticsearch_additional_java_opts: ''
elasticsearch_additional_java_opts: '-server -Djava.awt.headless=true'
elasticsearch_max_open_files: 65536
# bin/plugin for 2.x, bin/elasticsearch-plugin for 5.x
elasticsearch_plugin_bin: /usr/share/elasticsearch/bin/elasticsearch-plugin
#elasticsearch_plugin_bin: /usr/share/elasticsearch/bin/elasticsearch-plugin
elasticsearch_plugin_bin: /usr/share/elasticsearch/bin/plugin
#elasticsearch_plugins:
# - { name: 'royrusso/elasticsearch-HQ', state: 'present' }
# elasticsearch 5 not supported yet
elasticsearch_hq_install: False
# elasticsearch 5 not supported yet, so set it to False when installing 5.x
elasticsearch_hq_install: True
elasticsearch_hq_plugin:
- { name: 'royrusso/elasticsearch-HQ', state: 'present' }

View File

@ -17,8 +17,6 @@ LOG_DIR={{ elasticsearch_log_dir }}
# Elasticsearch PID directory
#PID_DIR=/var/run/elasticsearch
{% if elasticsearch_define_heap_size %}
# 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={{ elasticsearch_heap_size }}
# Heap new generation
@ -26,10 +24,9 @@ ES_HEAP_SIZE={{ elasticsearch_heap_size }}
# Maximum direct memory
#ES_DIRECT_SIZE=
{% endif %}
# Additional Java OPTS
ES_JAVA_OPTS={{ elasticsearch_additional_java_opts }}
ES_JAVA_OPTS="{{ elasticsearch_additional_java_opts }}"
# Configure restart on package upgrade (true, every other setting will lead to not restarting)
#ES_RESTART_ON_UPGRADE=true
@ -63,14 +60,12 @@ ES_STARTUP_SLEEP_TIME=5
# /usr/lib/systemd/system/elasticsearch.service takes precedence
MAX_OPEN_FILES={{ elasticsearch_max_open_files }}
{% if elasticsearch_define_heap_size %}
# The maximum number of bytes of memory that may be locked into RAM
# Set to "unlimited" if you use the 'bootstrap.mlockall: true' option
# in elasticsearch.yml (ES_HEAP_SIZE must also be set).
# When using Systemd, the LimitMEMLOCK property must be set
# in /usr/lib/systemd/system/elasticsearch.service
MAX_LOCKED_MEMORY=unlimited
{% endif %}
# Maximum number of VMA (Virtual Memory Areas) a process can own
# When using Systemd, this setting is ignored and the 'vm.max_map_count'

View File

@ -36,7 +36,6 @@ path.data: {{ elasticsearch_data_dir }}
#
path.logs: {{ elasticsearch_log_dir }}
#
{% if elasticsearch_define_heap_size %}
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
@ -48,7 +47,6 @@ bootstrap.mlockall: true
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
{% endif %}
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):