Skip to content

Commit eb16aac

Browse files
committed
Add docs about TimeoutStartSec in systemd (#91333)
Adds a short note about the effects of `TimeoutStartSec` in older `systemd` versions.
1 parent cab5520 commit eb16aac

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/reference/setup/install/systemd.asciidoc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,39 @@ sudo journalctl --unit elasticsearch --since "2016-10-30 18:17:16"
6464

6565
Check `man journalctl` or https://www.freedesktop.org/software/systemd/man/journalctl.html for
6666
more command line options.
67+
68+
[TIP]
69+
.Startup timeouts with older `systemd` versions
70+
====
71+
By default {es} sets the `TimeoutStartSec` parameter to `systemd` to `75s`. If
72+
you are running at least version 238 of `systemd` then {es} can automatically
73+
extend the startup timeout, and will do so repeatedly until startup is complete
74+
even if it takes longer than 75s.
75+
76+
Versions of `systemd` prior to 238 do not support the timeout extension
77+
mechanism and will terminate the {es} process if it has not fully started up
78+
within the configured timeout. If this happens, {es} will report in its logs
79+
that it was shut down normally a short time after it started:
80+
81+
[source,text]
82+
-------------
83+
[2022-01-31T01:22:31,077][INFO ][o.e.n.Node ] [instance-0000000123] starting ...
84+
...
85+
[2022-01-31T01:23:45,077][INFO ][o.e.n.Node ] [instance-0000000123] stopping ...
86+
-------------
87+
88+
However the `systemd` logs will report that the startup timed out:
89+
90+
[source,text]
91+
-------------
92+
Jan 31 01:22:30 debian systemd[1]: Starting Elasticsearch...
93+
Jan 31 01:23:45 debian systemd[1]: elasticsearch.service: Start operation timed out. Terminating.
94+
Jan 31 01:23:45 debian systemd[1]: elasticsearch.service: Main process exited, code=killed, status=15/TERM
95+
Jan 31 01:23:45 debian systemd[1]: elasticsearch.service: Failed with result 'timeout'.
96+
Jan 31 01:23:45 debian systemd[1]: Failed to start Elasticsearch.
97+
-------------
98+
99+
To avoid this, upgrade your `systemd` to at least version 238. You can also
100+
temporarily work around the problem by extending the `TimeoutStartSec`
101+
parameter.
102+
====

0 commit comments

Comments
 (0)