Add the ability to set the JVM heap size
This change makes it possible for users to set the `elastic_heap_size_default` value. Before this change, the option was unreachable due to a series of facts ganerated template values. The options `elastic_heap_size` or `logstash_heap_size` have also been exposed giving deployers the ability to define service specific heap sizes as needed. Change-Id: Ida3a57fdcff388f8e4bb3f325b787205a6183970 Signed-off-by: Kevin Carter <kevin@cloudnull.com>
This commit is contained in:
parent
78221b17d4
commit
6017fc0e89
@ -42,3 +42,8 @@ elastic_lxc_template_config:
|
|||||||
2:
|
2:
|
||||||
aa_profile: lxc.aa_profile
|
aa_profile: lxc.aa_profile
|
||||||
mount: lxc.mount.entry
|
mount: lxc.mount.entry
|
||||||
|
|
||||||
|
# Set the elastic search heap size. If this option is undefined the value will
|
||||||
|
# be derived automatically using 1/4 of the available RAM for logstash and 1/2
|
||||||
|
# of the available RAM for elasticsearch. The value is expected to be in MiB.
|
||||||
|
# elastic_heap_size_default: 10240 # type `int`
|
||||||
|
@ -49,9 +49,8 @@
|
|||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Set elastic heap defaults
|
- name: Set elastic log rotate path
|
||||||
set_fact:
|
set_fact:
|
||||||
elastic_heap_size_default: "{{ _elastic_heap_size_default }}"
|
|
||||||
elastic_log_rotate_path: "/var/log/{{ service_name }}"
|
elastic_log_rotate_path: "/var/log/{{ service_name }}"
|
||||||
|
|
||||||
- name: Configure systcl vm.max_map_count=524288 on elastic hosts
|
- name: Configure systcl vm.max_map_count=524288 on elastic hosts
|
||||||
|
@ -86,3 +86,8 @@ logstash_arcsight_event_brokers: []
|
|||||||
## detect the media type where the queue will exist. If the media type is
|
## detect the media type where the queue will exist. If the media type is
|
||||||
## "rotational" in memory queues will be used.
|
## "rotational" in memory queues will be used.
|
||||||
# logstash_queue_type:
|
# logstash_queue_type:
|
||||||
|
|
||||||
|
# Set the logstash search heap size. If this option is undefined the value will
|
||||||
|
# be derived automatically using 1/4 of the available RAM for logstash and 1/2
|
||||||
|
# of the available RAM for elasticsearch. The value is expected to be in MiB.
|
||||||
|
# logstash_heap_size: 10240 # type `int`
|
||||||
|
@ -71,6 +71,12 @@
|
|||||||
- key: LS_OPEN_FILES
|
- key: LS_OPEN_FILES
|
||||||
value: 32768
|
value: 32768
|
||||||
|
|
||||||
|
- name: Set service specific haap size
|
||||||
|
set_fact:
|
||||||
|
_service_heap_size: "{{ logstash_heap_size }}"
|
||||||
|
when:
|
||||||
|
- logstash_heap_size is defined
|
||||||
|
|
||||||
- name: Drop jvm conf file(s)
|
- name: Drop jvm conf file(s)
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
|
@ -28,3 +28,8 @@ elastic_plugins:
|
|||||||
- ingest-attachment
|
- ingest-attachment
|
||||||
- ingest-geoip
|
- ingest-geoip
|
||||||
- ingest-user-agent
|
- ingest-user-agent
|
||||||
|
|
||||||
|
# Set the logstash search heap size. If this option is undefined the value will
|
||||||
|
# be derived automatically using 1/4 of the available RAM for logstash and 1/2
|
||||||
|
# of the available RAM for elasticsearch. The value is expected to be in MiB.
|
||||||
|
# elastic_heap_size: 10240 # type `int`
|
||||||
|
@ -81,6 +81,12 @@
|
|||||||
- key: MAX_MAP_COUNT
|
- key: MAX_MAP_COUNT
|
||||||
value: 524288
|
value: 524288
|
||||||
|
|
||||||
|
- name: Set service specific haap size
|
||||||
|
set_fact:
|
||||||
|
_service_heap_size: "{{ elastic_heap_size }}"
|
||||||
|
when:
|
||||||
|
- elastic_heap_size is defined
|
||||||
|
|
||||||
- name: Drop jvm conf file(s)
|
- name: Drop jvm conf file(s)
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
|
@ -13,5 +13,4 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# Set elasticsearch facts
|
place_holder: true
|
||||||
elastic_heap_size: "{{ elastic_heap_size_default }}"
|
|
||||||
|
@ -18,7 +18,6 @@ elasticsearch_node_master: false
|
|||||||
elasticsearch_node_data: false
|
elasticsearch_node_data: false
|
||||||
elasticsearch_node_ingest: false
|
elasticsearch_node_ingest: false
|
||||||
elastic_coordination_node: true
|
elastic_coordination_node: true
|
||||||
elastic_heap_size: "{{ (elastic_heap_size_default | int) // 3 }}"
|
|
||||||
|
|
||||||
# This variable is redefined because kibana runs elasticsearch but only in a
|
# This variable is redefined because kibana runs elasticsearch but only in a
|
||||||
# load balancer capacity.
|
# load balancer capacity.
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
## JVM configuration
|
## JVM configuration
|
||||||
{% if (not (elasticsearch_node_master | default(master_node)) | bool) and (not (elasticsearch_node_data | default(data_node)) | bool) %}
|
{% if _service_heap_size is defined %}
|
||||||
{% set heap_size = (elastic_heap_size_default | int) // 2 %}
|
{% set heap_size = _service_heap_size %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set heap_size = (elastic_heap_size_default | int) %}
|
{% if (not (elasticsearch_node_master | default(master_node)) | bool) and (not (elasticsearch_node_data | default(data_node)) | bool) %}
|
||||||
|
{% set heap_size = elastic_heap_size_default | default((_elastic_heap_size_default | int) // 2) %}
|
||||||
|
{% else %}
|
||||||
|
{% set heap_size = elastic_heap_size_default | default(_elastic_heap_size_default | int) %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# Xms represents the initial size of total heap space
|
# Xms represents the initial size of total heap space
|
||||||
-Xms{{ heap_size }}m
|
-Xms{{ heap_size }}m
|
||||||
|
Loading…
x
Reference in New Issue
Block a user