Skip to content

Commit 70ec193

Browse files
committed
[DOCS] Starting Elasticsearch (#31701)
1 parent 6059e37 commit 70ec193

14 files changed

+189
-108
lines changed

docs/reference/setup.asciidoc

+2
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[]
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

+3-20
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

-2
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
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`.
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

+3-21
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

+1-17
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
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.
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+

docs/reference/setup/install/zip-targz.asciidoc

+2-37
Original file line numberDiff line numberDiff line change
@@ -90,50 +90,15 @@ include::xpack-indices.asciidoc[]
9090
endif::include-xpack[]
9191

9292
[[zip-targz-running]]
93-
==== Running Elasticsearch from the command line
94-
95-
Elasticsearch can be started from the command line as follows:
96-
97-
[source,sh]
98-
--------------------------------------------
99-
./bin/elasticsearch
100-
--------------------------------------------
101-
102-
By default, Elasticsearch runs in the foreground, prints its logs to the
103-
standard output (`stdout`), and can be stopped by pressing `Ctrl-C`.
104-
105-
NOTE: All scripts packaged with Elasticsearch require a version of Bash
106-
that supports arrays and assume that Bash is available at `/bin/bash`.
107-
As such, Bash should be available at this path either directly or via a
108-
symbolic link.
93+
include::zip-targz-start.asciidoc[]
10994

11095
include::check-running.asciidoc[]
11196

11297
Log printing to `stdout` can be disabled using the `-q` or `--quiet`
11398
option on the command line.
11499

115100
[[setup-installation-daemon]]
116-
==== Running as a daemon
117-
118-
To run Elasticsearch as a daemon, specify `-d` on the command line, and record
119-
the process ID in a file using the `-p` option:
120-
121-
[source,sh]
122-
--------------------------------------------
123-
./bin/elasticsearch -d -p pid
124-
--------------------------------------------
125-
126-
Log messages can be found in the `$ES_HOME/logs/` directory.
127-
128-
To shut down Elasticsearch, kill the process ID recorded in the `pid` file:
129-
130-
[source,sh]
131-
--------------------------------------------
132-
kill `cat pid`
133-
--------------------------------------------
134-
135-
NOTE: The startup scripts provided in the <<rpm,RPM>> and <<deb,Debian>>
136-
packages take care of starting and stopping the Elasticsearch process for you.
101+
include::zip-targz-daemon.asciidoc[]
137102

138103
[[zip-targz-configuring]]
139104
==== Configuring Elasticsearch on the command line
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.bat
8+
--------------------------------------------
9+
10+
By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT`,
11+
and can be stopped by pressing `Ctrl-C`.

docs/reference/setup/install/zip-windows.asciidoc

+1-11
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,7 @@ include::xpack-indices.asciidoc[]
5858
endif::include-xpack[]
5959

6060
[[windows-running]]
61-
==== Running Elasticsearch from the command line
62-
63-
Elasticsearch can be started from the command line as follows:
64-
65-
[source,sh]
66-
--------------------------------------------
67-
.\bin\elasticsearch.bat
68-
--------------------------------------------
69-
70-
By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT`,
71-
and can be stopped by pressing `Ctrl-C`.
61+
include::zip-windows-start.asciidoc[]
7262

7363
[[windows-configuring]]
7464
==== Configuring Elasticsearch on the command line
+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[[starting-elasticsearch]]
2+
== Starting Elasticsearch
3+
4+
The method for starting {es} varies depending on how you installed it.
5+
6+
[float]
7+
[[start-targz]]
8+
=== Archive packages (`.tar.gz`)
9+
10+
If you installed {es} with a `.tar.gz` package, you can start {es} from the
11+
command line.
12+
13+
[float]
14+
include::install/zip-targz-start.asciidoc[]
15+
16+
[float]
17+
include::install/zip-targz-daemon.asciidoc[]
18+
19+
[float]
20+
[[start-zip]]
21+
=== Archive packages (`.zip`)
22+
23+
If you installed {es} on Windows with a `.zip` package, you can start {es} from
24+
the command line. If you want {es} to start automatically at boot time without
25+
any user interaction, <<windows-service,install {es} as a service>>.
26+
27+
[float]
28+
include::install/zip-windows-start.asciidoc[]
29+
30+
[float]
31+
[[start-deb]]
32+
=== Debian packages
33+
34+
include::install/init-systemd.asciidoc[]
35+
36+
[float]
37+
include::install/deb-init.asciidoc[]
38+
39+
[float]
40+
include::install/systemd.asciidoc[]
41+
42+
[float]
43+
[[start-docker]]
44+
=== Docker images
45+
46+
If you installed a Docker image, you can start {es} from the command line. There
47+
are different methods depending on whether you're using development mode or
48+
production mode. See <<docker-cli-run>>.
49+
50+
[float]
51+
[[start-msi]]
52+
=== MSI packages
53+
54+
If you installed {es} on Windows using the `.msi` package, you can start {es}
55+
from the command line. If you want it to start automatically at boot time
56+
without any user interaction,
57+
<<msi-installer-windows-service,install {es} as a Windows service>>.
58+
59+
[float]
60+
include::install/msi-windows-start.asciidoc[]
61+
62+
[float]
63+
[[start-rpm]]
64+
=== RPM packages
65+
66+
include::install/init-systemd.asciidoc[]
67+
68+
[float]
69+
include::install/rpm-init.asciidoc[]
70+
71+
[float]
72+
include::install/systemd.asciidoc[]

0 commit comments

Comments
 (0)