From de88293f2451794ea6e8738679423d0b10b5fb73 Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Thu, 7 Jan 2021 10:44:29 +0100 Subject: [PATCH] Allow longer timeouts for elasticsearch.service /usr/lib/systemd/system/elasticsearch.service comes with a TimeoutStartSec=75, which is not enough time for a somewhat busy E5-2430L v2 @ 2.40GHz to get things going. We don't want to permanently override that with a default of 75 in case they decide to bump or remove that timeout in the future. Change-Id: Ida8668f5548a15a8f597839bd9002585aeea5d1a --- elk_metrics_7x/roles/elasticsearch/defaults/main.yml | 8 ++++++-- .../templates/systemd.elasticsearch-overrides.conf.j2 | 5 +++++ elk_metrics_7x/tests/test-vars.yml | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/elk_metrics_7x/roles/elasticsearch/defaults/main.yml b/elk_metrics_7x/roles/elasticsearch/defaults/main.yml index 87e799e5..f30f26c5 100644 --- a/elk_metrics_7x/roles/elasticsearch/defaults/main.yml +++ b/elk_metrics_7x/roles/elasticsearch/defaults/main.yml @@ -39,10 +39,14 @@ elastic_plugins: # of the available RAM for elasticsearch. The value is expected to be in MiB. # elastic_heap_size: 10240 # type `int` -# Set the addresses/interfaces for elasticsearch to bind to. If undefined, this binds to -# localhost and the ansible_host and ansible_hostname addresses. +# Set the addresses/interfaces for elasticsearch to bind to. If undefined, this +# binds to localhost and the ansible_host and ansible_hostname addresses. elasticsearch_bind_addresses: ["127.0.0.1", "{{ ansible_host }}", "{{ ansible_hostname }}"] # Set a master-eligible node to be voting only # By default this is set to False - all masters can be elected by default # elasticsearch_voting_only: true + +# Allow a slow startup before the systemd notifier module kicks in to extend +# the timeout. +#elastic_systemd_timeout: 75 diff --git a/elk_metrics_7x/roles/elasticsearch/templates/systemd.elasticsearch-overrides.conf.j2 b/elk_metrics_7x/roles/elasticsearch/templates/systemd.elasticsearch-overrides.conf.j2 index 64dcf40a..e0dbd57c 100644 --- a/elk_metrics_7x/roles/elasticsearch/templates/systemd.elasticsearch-overrides.conf.j2 +++ b/elk_metrics_7x/roles/elasticsearch/templates/systemd.elasticsearch-overrides.conf.j2 @@ -12,3 +12,8 @@ LimitMEMLOCK=infinity # Number of File Descriptors LimitNOFILE=65536 + +{% if elastic_systemd_timeout is defined %} +# Allow a slow startup before the systemd notifier module kicks in to extend the timeout +TimeoutStartSec={{ elastic_systemd_timeout }} +{% endif %} diff --git a/elk_metrics_7x/tests/test-vars.yml b/elk_metrics_7x/tests/test-vars.yml index afc78d7f..f37c803d 100644 --- a/elk_metrics_7x/tests/test-vars.yml +++ b/elk_metrics_7x/tests/test-vars.yml @@ -20,5 +20,6 @@ physical_host: localhost q_storage: 1 elastic_memory_lower_limit: 1024 elastic_memory_upper_limit: 1024 +elastic_systemd_timeout: 240 osa_test_repo: "openstack/openstack-ansible-ops"