From 2be071c5b07c0dc9a8a3d7ce72645ffa5192c100 Mon Sep 17 00:00:00 2001 From: Saravanan Palanisamy Date: Tue, 2 Nov 2021 00:24:53 +0400 Subject: [PATCH] [issue - 9] Add important settings recommendations (#10) * add important settings in dashboards Signed-off-by: saravanan palanisamy --- roles/centos7/dashboards/tasks/main.yml | 3 +++ roles/centos7/dashboards/tasks/tune.yml | 6 ++++++ .../centos7/dashboards/templates/dashboards.service | 2 +- roles/centos7/opensearch/tasks/main.yml | 3 +++ roles/centos7/opensearch/tasks/tune.yml | 12 ++++++++++++ .../centos7/opensearch/templates/opensearch.service | 5 ++++- roles/centos7/opensearch/templates/opensearch.yml | 2 ++ 7 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 roles/centos7/dashboards/tasks/tune.yml create mode 100644 roles/centos7/opensearch/tasks/tune.yml diff --git a/roles/centos7/dashboards/tasks/main.yml b/roles/centos7/dashboards/tasks/main.yml index 3d890b6..1cce57a 100644 --- a/roles/centos7/dashboards/tasks/main.yml +++ b/roles/centos7/dashboards/tasks/main.yml @@ -10,6 +10,9 @@ - name: Populate the nodes to /etc/hosts import_tasks: etchosts.yml +- name: Tune the system settings + import_tasks: tune.yml + - name: include dashboards installation include: dashboards.yml diff --git a/roles/centos7/dashboards/tasks/tune.yml b/roles/centos7/dashboards/tasks/tune.yml new file mode 100644 index 0000000..bac849e --- /dev/null +++ b/roles/centos7/dashboards/tasks/tune.yml @@ -0,0 +1,6 @@ +--- +- name: Set open files limit in sysctl.conf + sysctl: + name: fs.file-max + value: 65536 + state: present diff --git a/roles/centos7/dashboards/templates/dashboards.service b/roles/centos7/dashboards/templates/dashboards.service index 31e2f16..e0325a7 100644 --- a/roles/centos7/dashboards/templates/dashboards.service +++ b/roles/centos7/dashboards/templates/dashboards.service @@ -18,7 +18,7 @@ StandardOutput=journal StandardError=inherit # Specifies the maximum file descriptor number that can be opened by this process -LimitNOFILE=65535 +LimitNOFILE=65536 # Specifies the maximum number of processes LimitNPROC=4096 diff --git a/roles/centos7/opensearch/tasks/main.yml b/roles/centos7/opensearch/tasks/main.yml index 1b9c8b7..649f338 100644 --- a/roles/centos7/opensearch/tasks/main.yml +++ b/roles/centos7/opensearch/tasks/main.yml @@ -10,6 +10,9 @@ - name: Populate the nodes to /etc/hosts import_tasks: etchosts.yml +- name: Tune the system settings + import_tasks: tune.yml + - name: include opensearch installation include: opensearch.yml diff --git a/roles/centos7/opensearch/tasks/tune.yml b/roles/centos7/opensearch/tasks/tune.yml new file mode 100644 index 0000000..672abda --- /dev/null +++ b/roles/centos7/opensearch/tasks/tune.yml @@ -0,0 +1,12 @@ +--- +- name: Set vm.max_map_count in sysctl.conf + sysctl: + name: vm.max_map_count + value: 262144 + state: present + +- name: Set open files limit in sysctl.conf + sysctl: + name: fs.file-max + value: 65536 + state: present diff --git a/roles/centos7/opensearch/templates/opensearch.service b/roles/centos7/opensearch/templates/opensearch.service index a597e64..cddb554 100644 --- a/roles/centos7/opensearch/templates/opensearch.service +++ b/roles/centos7/opensearch/templates/opensearch.service @@ -18,7 +18,10 @@ StandardOutput=journal StandardError=inherit # Specifies the maximum file descriptor number that can be opened by this process -LimitNOFILE=65535 +LimitNOFILE=65536 + +# Specifies the memory lock settings +LimitMEMLOCK=infinity # Specifies the maximum number of processes LimitNPROC=4096 diff --git a/roles/centos7/opensearch/templates/opensearch.yml b/roles/centos7/opensearch/templates/opensearch.yml index 447c840..c38aaf3 100644 --- a/roles/centos7/opensearch/templates/opensearch.yml +++ b/roles/centos7/opensearch/templates/opensearch.yml @@ -7,3 +7,5 @@ network.host: "{{ hostvars[inventory_hostname]['ip'] }}" http.port: 9200 discovery.type: single-node + +bootstrap.memory_lock: true