You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy-manage/maintenance/start-stop-services/start-stop-elasticsearch.md
+7-156Lines changed: 7 additions & 156 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,170 +40,21 @@ If you installed {{es}} on Windows with a `.zip` package, you can start {{es}} f
40
40
41
41
If you're starting {{es}} for the first time, then {{es}} also enables and configures security. [Learn more](/deploy-manage/deploy/self-managed/install-elasticsearch-with-zip-on-windows.md#security-at-startup).
42
42
43
-
### Debian packages [start-deb]
43
+
### Debian or RPM packages (using `systemd`)[start-deb]
44
44
45
-
#### Running {{es}} with `systemd`[start-es-deb-systemd]
46
-
47
-
To configure {{es}} to start automatically when the system boots up, run the following commands:
48
-
49
-
```sh
50
-
sudo /bin/systemctl daemon-reload
51
-
sudo /bin/systemctl enable elasticsearch.service
52
-
```
53
-
54
-
{{es}} can be started and stopped as follows:
55
-
56
-
```sh
57
-
sudo systemctl start elasticsearch.service
58
-
sudo systemctl stop elasticsearch.service
59
-
```
60
-
61
-
These commands provide no feedback as to whether {{es}} was started successfully or not. Instead, this information will be written in the log files located in `/var/log/{{es}}/`.
62
-
63
-
If you have password-protected your {{es}} keystore, you will need to provide `systemd` with the keystore password using a local file and systemd environment variables. This local file should be protected while it exists and may be safely deleted once {{es}} is up and running.
By default the {{es}} service doesn’t log information in the `systemd` journal. To enable `journalctl` logging, the `--quiet` option must be removed from the `ExecStart` command line in the `elasticsearch.service` file.
73
-
74
-
When `systemd` logging is enabled, the logging information are available using the `journalctl` commands:
75
-
76
-
To tail the journal:
77
-
78
-
```sh
79
-
sudo journalctl -f
80
-
```
81
-
82
-
To list journal entries for the {{es}} service:
83
-
84
-
```sh
85
-
sudo journalctl --unit elasticsearch
86
-
```
87
-
88
-
To list journal entries for the {{es}} service starting from a given time:
Check `man journalctl` or [https://www.freedesktop.org/software/systemd/man/journalctl.html](https://www.freedesktop.org/software/systemd/man/journalctl.html) for more command line options.
95
-
96
-
::::{admonition} Startup timeouts with older systemd versions
97
-
:class: tip
98
-
99
-
By default {{es}} sets the `TimeoutStartSec` parameter to `systemd` to `900s`. If you are running at least version 238 of `systemd` then {{es}} can automatically extend the startup timeout, and will do so repeatedly until startup is complete even if it takes longer than 900s.
100
-
101
-
Versions of `systemd` prior to 238 do not support the timeout extension mechanism and will terminate the {{es}} process if it has not fully started up within the configured timeout. If this happens, {{es}} will report in its logs that it was shut down normally a short time after it started:
To avoid this, upgrade your `systemd` to at least version 238. You can also temporarily work around the problem by extending the `TimeoutStartSec` parameter.
If you installed a Docker image, you can start {{es}} from the command line. There are different methods depending on whether you’re using development mode or production mode. See [](../../../deploy-manage/deploy/self-managed/install-elasticsearch-with-docker.md).
126
57
127
-
### RPM packages [start-rpm]
128
-
129
-
#### Running {{es}} with `systemd`[start-es-rpm-systemd]
130
-
131
-
To configure {{es}} to start automatically when the system boots up, run the following commands:
132
-
133
-
```sh
134
-
sudo /bin/systemctl daemon-reload
135
-
sudo /bin/systemctl enable elasticsearch.service
136
-
```
137
-
138
-
{{es}} can be started and stopped as follows:
139
-
140
-
```sh
141
-
sudo systemctl start elasticsearch.service
142
-
sudo systemctl stop elasticsearch.service
143
-
```
144
-
145
-
These commands provide no feedback as to whether {{es}} was started successfully or not. Instead, this information will be written in the log files located in `/var/log/{{es}}/`.
146
-
147
-
If you have password-protected your {{es}} keystore, you will need to provide `systemd` with the keystore password using a local file and systemd environment variables. This local file should be protected while it exists and may be safely deleted once {{es}} is up and running.
By default the {{es}} service doesn’t log information in the `systemd` journal. To enable `journalctl` logging, the `--quiet` option must be removed from the `ExecStart` command line in the `elasticsearch.service` file.
157
-
158
-
When `systemd` logging is enabled, the logging information are available using the `journalctl` commands:
159
-
160
-
To tail the journal:
161
-
162
-
```sh
163
-
sudo journalctl -f
164
-
```
165
-
166
-
To list journal entries for the {{es}} service:
167
-
168
-
```sh
169
-
sudo journalctl --unit elasticsearch
170
-
```
171
-
172
-
To list journal entries for the {{es}} service starting from a given time:
Check `man journalctl` or [https://www.freedesktop.org/software/systemd/man/journalctl.html](https://www.freedesktop.org/software/systemd/man/journalctl.html) for more command line options.
179
-
180
-
::::{admonition} Startup timeouts with older systemd versions
181
-
:class: tip
182
-
183
-
By default {{es}} sets the `TimeoutStartSec` parameter to `systemd` to `900s`. If you are running at least version 238 of `systemd` then {{es}} can automatically extend the startup timeout, and will do so repeatedly until startup is complete even if it takes longer than 900s.
184
-
185
-
Versions of `systemd` prior to 238 do not support the timeout extension mechanism and will terminate the {{es}} process if it has not fully started up within the configured timeout. If this happens, {{es}} will report in its logs that it was shut down normally a short time after it started:
Jan 31 01:37:15 debian systemd[1]: elasticsearch.service: Main process exited, code=killed, status=15/TERM
199
-
Jan 31 01:37:15 debian systemd[1]: elasticsearch.service: Failed with result 'timeout'.
200
-
Jan 31 01:37:15 debian systemd[1]: Failed to start elasticsearch.
201
-
```
202
-
203
-
To avoid this, upgrade your `systemd` to at least version 238. You can also temporarily work around the problem by extending the `TimeoutStartSec` parameter.
204
-
205
-
::::
206
-
207
58
## Stopping {{es}} [stopping-elasticsearch]
208
59
209
60
An orderly shutdown of {{es}} ensures that {{es}} has a chance to cleanup and close outstanding resources. For example, a node that is shutdown in an orderly fashion will remove itself from the cluster, sync translogs to disk, and perform other related cleanup activities. You can help ensure an orderly shutdown by properly stopping {{es}}.
0 commit comments