Skip to content

Commit ac7fadd

Browse files
authored
[DOCS] Starting Elasticsearch (#31701)
1 parent a02e5ee commit ac7fadd

14 files changed

+189
-108
lines changed

docs/reference/setup.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ include::setup/sysconfig.asciidoc[]
5555

5656
include::setup/bootstrap-checks.asciidoc[]
5757

58+
include::setup/starting.asciidoc[]
59+
5860
include::setup/stopping.asciidoc[]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
==== Running Elasticsearch with SysV `init`
2+
3+
Use the `update-rc.d` command to configure Elasticsearch to start automatically
4+
when the system boots up:
5+
6+
[source,sh]
7+
--------------------------------------------------
8+
sudo update-rc.d elasticsearch defaults 95 10
9+
--------------------------------------------------
10+
11+
Elasticsearch can be started and stopped using the `service` command:
12+
13+
[source,sh]
14+
--------------------------------------------
15+
sudo -i service elasticsearch start
16+
sudo -i service elasticsearch stop
17+
--------------------------------------------
18+
19+
If Elasticsearch fails to start for any reason, it will print the reason for
20+
failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.

docs/reference/setup/install/deb.asciidoc

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,29 +143,12 @@ include::xpack-indices.asciidoc[]
143143

144144
endif::include-xpack[]
145145

146+
==== SysV `init` vs `systemd`
147+
146148
include::init-systemd.asciidoc[]
147149

148150
[[deb-running-init]]
149-
==== Running Elasticsearch with SysV `init`
150-
151-
Use the `update-rc.d` command to configure Elasticsearch to start automatically
152-
when the system boots up:
153-
154-
[source,sh]
155-
--------------------------------------------------
156-
sudo update-rc.d elasticsearch defaults 95 10
157-
--------------------------------------------------
158-
159-
Elasticsearch can be started and stopped using the `service` command:
160-
161-
[source,sh]
162-
--------------------------------------------
163-
sudo -i service elasticsearch start
164-
sudo -i service elasticsearch stop
165-
--------------------------------------------
166-
167-
If Elasticsearch fails to start for any reason, it will print the reason for
168-
failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.
151+
include::deb-init.asciidoc[]
169152

170153
[[deb-running-systemd]]
171154
include::systemd.asciidoc[]

docs/reference/setup/install/init-systemd.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
==== SysV `init` vs `systemd`
2-
31
Elasticsearch is not started automatically after installation. How to start
42
and stop Elasticsearch depends on whether your system uses SysV `init` or
53
`systemd` (used by newer distributions). You can tell which is being used by
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
==== Running Elasticsearch from the command line
2+
3+
Once installed, Elasticsearch can be started from the command line, if not installed as a service
4+
and configured to start when installation completes, as follows:
5+
6+
["source","sh",subs="attributes,callouts"]
7+
--------------------------------------------
8+
.\bin\elasticsearch.exe
9+
--------------------------------------------
10+
11+
The command line terminal will display output similar to the following:
12+
13+
image::images/msi_installer/elasticsearch_exe.png[]
14+
15+
By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT` in addition
16+
to the `<cluster name>.log` file within `LOGSDIRECTORY`, and can be stopped by pressing `Ctrl-C`.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
==== Running Elasticsearch with SysV `init`
2+
3+
Use the `chkconfig` command to configure Elasticsearch to start automatically
4+
when the system boots up:
5+
6+
[source,sh]
7+
--------------------------------------------------
8+
sudo chkconfig --add elasticsearch
9+
--------------------------------------------------
10+
11+
Elasticsearch can be started and stopped using the `service` command:
12+
13+
[source,sh]
14+
--------------------------------------------
15+
sudo -i service elasticsearch start
16+
sudo -i service elasticsearch stop
17+
--------------------------------------------
18+
19+
If Elasticsearch fails to start for any reason, it will print the reason for
20+
failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.

docs/reference/setup/install/rpm.asciidoc

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,12 @@ include::xpack-indices.asciidoc[]
130130

131131
endif::include-xpack[]
132132

133+
==== SysV `init` vs `systemd`
134+
133135
include::init-systemd.asciidoc[]
134136

135137
[[rpm-running-init]]
136-
==== Running Elasticsearch with SysV `init`
137-
138-
Use the `chkconfig` command to configure Elasticsearch to start automatically
139-
when the system boots up:
140-
141-
[source,sh]
142-
--------------------------------------------------
143-
sudo chkconfig --add elasticsearch
144-
--------------------------------------------------
145-
146-
Elasticsearch can be started and stopped using the `service` command:
147-
148-
[source,sh]
149-
--------------------------------------------
150-
sudo -i service elasticsearch start
151-
sudo -i service elasticsearch stop
152-
--------------------------------------------
153-
154-
If Elasticsearch fails to start for any reason, it will print the reason for
155-
failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`.
156-
138+
include::rpm-init.asciidoc[]
157139

158140
[[rpm-running-systemd]]
159141
include::systemd.asciidoc[]

docs/reference/setup/install/windows.asciidoc

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -342,23 +342,7 @@ include::xpack-indices.asciidoc[]
342342
endif::include-xpack[]
343343

344344
[[msi-installer-command-line-running]]
345-
==== Running Elasticsearch from the command line
346-
347-
Once installed, Elasticsearch can be started from the command line, if not installed as a service
348-
and configured to start when installation completes, as follows:
349-
350-
["source","sh",subs="attributes,callouts"]
351-
--------------------------------------------
352-
.\bin\elasticsearch.exe
353-
--------------------------------------------
354-
355-
The command line terminal will display output similar to the following:
356-
357-
[[msi-installer-elasticsearch-exe]]
358-
image::images/msi_installer/elasticsearch_exe.png[]
359-
360-
By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT` in addition
361-
to the `<cluster name>.log` file within `LOGSDIRECTORY`, and can be stopped by pressing `Ctrl-C`.
345+
include::msi-windows-start.asciidoc[]
362346

363347
[[msi-installer-command-line-configuration]]
364348
==== Configuring Elasticsearch on the command line
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
==== Running as a daemon
2+
3+
To run Elasticsearch as a daemon, specify `-d` on the command line, and record
4+
the process ID in a file using the `-p` option:
5+
6+
[source,sh]
7+
--------------------------------------------
8+
./bin/elasticsearch -d -p pid
9+
--------------------------------------------
10+
11+
Log messages can be found in the `$ES_HOME/logs/` directory.
12+
13+
To shut down Elasticsearch, kill the process ID recorded in the `pid` file:
14+
15+
[source,sh]
16+
--------------------------------------------
17+
kill `cat pid`
18+
--------------------------------------------
19+
20+
NOTE: The startup scripts provided in the <<rpm,RPM>> and <<deb,Debian>>
21+
packages take care of starting and stopping the Elasticsearch process for you.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
==== Running Elasticsearch from the command line
2+
3+
Elasticsearch can be started from the command line as follows:
4+
5+
[source,sh]
6+
--------------------------------------------
7+
./bin/elasticsearch
8+
--------------------------------------------
9+
10+
By default, Elasticsearch runs in the foreground, prints its logs to the
11+
standard output (`stdout`), and can be stopped by pressing `Ctrl-C`.
12+
13+
NOTE: All scripts packaged with Elasticsearch require a version of Bash
14+
that supports arrays and assume that Bash is available at `/bin/bash`.
15+
As such, Bash should be available at this path either directly or via a
16+
symbolic link.
17+

0 commit comments

Comments
 (0)