diff --git a/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml b/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml index 1ee64e4a..2213efad 100644 --- a/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_dependencies/tasks/main.yml @@ -60,6 +60,7 @@ value: "524288" state: "present" reload: "yes" + sysctl_file: /etc/sysctl.d/99-elasticsearch.conf delegate_to: "{{ physical_host }}" tags: - sysctl @@ -70,6 +71,7 @@ value: "1048576" state: "present" reload: "yes" + sysctl_file: /etc/sysctl.d/99-elasticsearch.conf delegate_to: "{{ physical_host }}" tags: - sysctl diff --git a/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml b/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml index 1d7863da..c4b1e164 100644 --- a/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml +++ b/elk_metrics_6x/roles/elastic_logstash/tasks/main.yml @@ -62,6 +62,15 @@ notify: - Enable and restart logstash +- name: Set sysconfig service defaults + lineinfile: + path: "{{ logstash_sysconfig_path }}" + regexp: '^{{ item.key }}=' + line: '{{ item.key }}={{ item.value }}' + with_items: + - key: LS_OPEN_FILES + value: 32768 + - name: Drop jvm conf file(s) template: src: "{{ item.src }}" diff --git a/elk_metrics_6x/roles/elastic_logstash/vars/redhat.yml b/elk_metrics_6x/roles/elastic_logstash/vars/redhat.yml index 716310e6..0d0e66ee 100644 --- a/elk_metrics_6x/roles/elastic_logstash/vars/redhat.yml +++ b/elk_metrics_6x/roles/elastic_logstash/vars/redhat.yml @@ -16,3 +16,5 @@ logstash_distro_packages: - logrotate - logstash + +logstash_sysconfig_path: /etc/default/logstash diff --git a/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml b/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml index 716310e6..0d0e66ee 100644 --- a/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml +++ b/elk_metrics_6x/roles/elastic_logstash/vars/suse.yml @@ -16,3 +16,5 @@ logstash_distro_packages: - logrotate - logstash + +logstash_sysconfig_path: /etc/default/logstash diff --git a/elk_metrics_6x/roles/elastic_logstash/vars/ubuntu.yml b/elk_metrics_6x/roles/elastic_logstash/vars/ubuntu.yml index 716310e6..0d0e66ee 100644 --- a/elk_metrics_6x/roles/elastic_logstash/vars/ubuntu.yml +++ b/elk_metrics_6x/roles/elastic_logstash/vars/ubuntu.yml @@ -16,3 +16,5 @@ logstash_distro_packages: - logrotate - logstash + +logstash_sysconfig_path: /etc/default/logstash diff --git a/elk_metrics_6x/roles/elasticsearch/tasks/main.yml b/elk_metrics_6x/roles/elasticsearch/tasks/main.yml index 31962d02..78d9ecf4 100644 --- a/elk_metrics_6x/roles/elasticsearch/tasks/main.yml +++ b/elk_metrics_6x/roles/elasticsearch/tasks/main.yml @@ -68,6 +68,19 @@ tags: - config +- name: Set sysconfig service defaults + lineinfile: + path: "{{ elasticsearch_sysconfig_path }}" + regexp: '^{{ item.key }}=' + line: '{{ item.key }}={{ item.value }}' + with_items: + - key: MAX_OPEN_FILES + value: 65536 + - key: MAX_LOCKED_MEMORY + value: unlimited + - key: MAX_MAP_COUNT + value: 524288 + - name: Drop jvm conf file(s) template: src: "{{ item.src }}" diff --git a/elk_metrics_6x/roles/elasticsearch/vars/redhat.yml b/elk_metrics_6x/roles/elasticsearch/vars/redhat.yml index a5948d12..d80edade 100644 --- a/elk_metrics_6x/roles/elasticsearch/vars/redhat.yml +++ b/elk_metrics_6x/roles/elasticsearch/vars/redhat.yml @@ -16,3 +16,5 @@ elasticsearch_distro_packages: - logrotate - elasticsearch + +elasticsearch_sysconfig_path: /etc/sysconfig/elasticsearch diff --git a/elk_metrics_6x/roles/elasticsearch/vars/suse.yml b/elk_metrics_6x/roles/elasticsearch/vars/suse.yml index a5948d12..d80edade 100644 --- a/elk_metrics_6x/roles/elasticsearch/vars/suse.yml +++ b/elk_metrics_6x/roles/elasticsearch/vars/suse.yml @@ -16,3 +16,5 @@ elasticsearch_distro_packages: - logrotate - elasticsearch + +elasticsearch_sysconfig_path: /etc/sysconfig/elasticsearch diff --git a/elk_metrics_6x/roles/elasticsearch/vars/ubuntu.yml b/elk_metrics_6x/roles/elasticsearch/vars/ubuntu.yml index a5948d12..0fc5886a 100644 --- a/elk_metrics_6x/roles/elasticsearch/vars/ubuntu.yml +++ b/elk_metrics_6x/roles/elasticsearch/vars/ubuntu.yml @@ -16,3 +16,5 @@ elasticsearch_distro_packages: - logrotate - elasticsearch + +elasticsearch_sysconfig_path: /etc/default/elasticsearch diff --git a/elk_metrics_6x/tests/functional.yml b/elk_metrics_6x/tests/functional.yml index c0f283fe..c992e1b2 100644 --- a/elk_metrics_6x/tests/functional.yml +++ b/elk_metrics_6x/tests/functional.yml @@ -57,6 +57,8 @@ name: vm.swappiness value: 10 state: present + reload: "yes" + sysctl_file: /etc/sysctl.d/99-elasticsearch.conf - name: Flush iptables rules command: "{{ item }}"