From ac7fadd3367aa70ba256a1133942a76c9f6ab333 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Tue, 3 Jul 2018 13:40:37 -0700 Subject: [PATCH] [DOCS] Starting Elasticsearch (#31701) --- docs/reference/setup.asciidoc | 2 + .../reference/setup/install/deb-init.asciidoc | 20 ++++++ docs/reference/setup/install/deb.asciidoc | 23 +----- .../setup/install/init-systemd.asciidoc | 2 - .../setup/install/msi-windows-start.asciidoc | 16 +++++ .../reference/setup/install/rpm-init.asciidoc | 20 ++++++ docs/reference/setup/install/rpm.asciidoc | 24 +------ docs/reference/setup/install/windows.asciidoc | 18 +---- .../setup/install/zip-targz-daemon.asciidoc | 21 ++++++ .../setup/install/zip-targz-start.asciidoc | 17 +++++ .../setup/install/zip-targz.asciidoc | 39 +--------- .../setup/install/zip-windows-start.asciidoc | 11 +++ .../setup/install/zip-windows.asciidoc | 12 +--- docs/reference/setup/starting.asciidoc | 72 +++++++++++++++++++ 14 files changed, 189 insertions(+), 108 deletions(-) create mode 100644 docs/reference/setup/install/deb-init.asciidoc create mode 100644 docs/reference/setup/install/msi-windows-start.asciidoc create mode 100644 docs/reference/setup/install/rpm-init.asciidoc create mode 100644 docs/reference/setup/install/zip-targz-daemon.asciidoc create mode 100644 docs/reference/setup/install/zip-targz-start.asciidoc create mode 100644 docs/reference/setup/install/zip-windows-start.asciidoc create mode 100644 docs/reference/setup/starting.asciidoc diff --git a/docs/reference/setup.asciidoc b/docs/reference/setup.asciidoc index b8516bdc6cb5c..60e3c1dac2948 100644 --- a/docs/reference/setup.asciidoc +++ b/docs/reference/setup.asciidoc @@ -55,4 +55,6 @@ include::setup/sysconfig.asciidoc[] include::setup/bootstrap-checks.asciidoc[] +include::setup/starting.asciidoc[] + include::setup/stopping.asciidoc[] diff --git a/docs/reference/setup/install/deb-init.asciidoc b/docs/reference/setup/install/deb-init.asciidoc new file mode 100644 index 0000000000000..0e6e142a82927 --- /dev/null +++ b/docs/reference/setup/install/deb-init.asciidoc @@ -0,0 +1,20 @@ +==== Running Elasticsearch with SysV `init` + +Use the `update-rc.d` command to configure Elasticsearch to start automatically +when the system boots up: + +[source,sh] +-------------------------------------------------- +sudo update-rc.d elasticsearch defaults 95 10 +-------------------------------------------------- + +Elasticsearch can be started and stopped using the `service` command: + +[source,sh] +-------------------------------------------- +sudo -i service elasticsearch start +sudo -i service elasticsearch stop +-------------------------------------------- + +If Elasticsearch fails to start for any reason, it will print the reason for +failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`. \ No newline at end of file diff --git a/docs/reference/setup/install/deb.asciidoc b/docs/reference/setup/install/deb.asciidoc index 2abacf947c7bc..629abe37afe62 100644 --- a/docs/reference/setup/install/deb.asciidoc +++ b/docs/reference/setup/install/deb.asciidoc @@ -143,29 +143,12 @@ include::xpack-indices.asciidoc[] endif::include-xpack[] +==== SysV `init` vs `systemd` + include::init-systemd.asciidoc[] [[deb-running-init]] -==== Running Elasticsearch with SysV `init` - -Use the `update-rc.d` command to configure Elasticsearch to start automatically -when the system boots up: - -[source,sh] --------------------------------------------------- -sudo update-rc.d elasticsearch defaults 95 10 --------------------------------------------------- - -Elasticsearch can be started and stopped using the `service` command: - -[source,sh] --------------------------------------------- -sudo -i service elasticsearch start -sudo -i service elasticsearch stop --------------------------------------------- - -If Elasticsearch fails to start for any reason, it will print the reason for -failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`. +include::deb-init.asciidoc[] [[deb-running-systemd]] include::systemd.asciidoc[] diff --git a/docs/reference/setup/install/init-systemd.asciidoc b/docs/reference/setup/install/init-systemd.asciidoc index 1532c5313aefd..144fe4c481275 100644 --- a/docs/reference/setup/install/init-systemd.asciidoc +++ b/docs/reference/setup/install/init-systemd.asciidoc @@ -1,5 +1,3 @@ -==== SysV `init` vs `systemd` - Elasticsearch is not started automatically after installation. How to start and stop Elasticsearch depends on whether your system uses SysV `init` or `systemd` (used by newer distributions). You can tell which is being used by diff --git a/docs/reference/setup/install/msi-windows-start.asciidoc b/docs/reference/setup/install/msi-windows-start.asciidoc new file mode 100644 index 0000000000000..28bcfed6af3de --- /dev/null +++ b/docs/reference/setup/install/msi-windows-start.asciidoc @@ -0,0 +1,16 @@ +==== Running Elasticsearch from the command line + +Once installed, Elasticsearch can be started from the command line, if not installed as a service +and configured to start when installation completes, as follows: + +["source","sh",subs="attributes,callouts"] +-------------------------------------------- +.\bin\elasticsearch.exe +-------------------------------------------- + +The command line terminal will display output similar to the following: + +image::images/msi_installer/elasticsearch_exe.png[] + +By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT` in addition +to the `.log` file within `LOGSDIRECTORY`, and can be stopped by pressing `Ctrl-C`. diff --git a/docs/reference/setup/install/rpm-init.asciidoc b/docs/reference/setup/install/rpm-init.asciidoc new file mode 100644 index 0000000000000..a3db166308caf --- /dev/null +++ b/docs/reference/setup/install/rpm-init.asciidoc @@ -0,0 +1,20 @@ +==== Running Elasticsearch with SysV `init` + +Use the `chkconfig` command to configure Elasticsearch to start automatically +when the system boots up: + +[source,sh] +-------------------------------------------------- +sudo chkconfig --add elasticsearch +-------------------------------------------------- + +Elasticsearch can be started and stopped using the `service` command: + +[source,sh] +-------------------------------------------- +sudo -i service elasticsearch start +sudo -i service elasticsearch stop +-------------------------------------------- + +If Elasticsearch fails to start for any reason, it will print the reason for +failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`. diff --git a/docs/reference/setup/install/rpm.asciidoc b/docs/reference/setup/install/rpm.asciidoc index aad7cf5bf3b73..a6f106497e9d2 100644 --- a/docs/reference/setup/install/rpm.asciidoc +++ b/docs/reference/setup/install/rpm.asciidoc @@ -130,30 +130,12 @@ include::xpack-indices.asciidoc[] endif::include-xpack[] +==== SysV `init` vs `systemd` + include::init-systemd.asciidoc[] [[rpm-running-init]] -==== Running Elasticsearch with SysV `init` - -Use the `chkconfig` command to configure Elasticsearch to start automatically -when the system boots up: - -[source,sh] --------------------------------------------------- -sudo chkconfig --add elasticsearch --------------------------------------------------- - -Elasticsearch can be started and stopped using the `service` command: - -[source,sh] --------------------------------------------- -sudo -i service elasticsearch start -sudo -i service elasticsearch stop --------------------------------------------- - -If Elasticsearch fails to start for any reason, it will print the reason for -failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`. - +include::rpm-init.asciidoc[] [[rpm-running-systemd]] include::systemd.asciidoc[] diff --git a/docs/reference/setup/install/windows.asciidoc b/docs/reference/setup/install/windows.asciidoc index 56bb953c18ebb..1535e5415e4a4 100644 --- a/docs/reference/setup/install/windows.asciidoc +++ b/docs/reference/setup/install/windows.asciidoc @@ -342,23 +342,7 @@ include::xpack-indices.asciidoc[] endif::include-xpack[] [[msi-installer-command-line-running]] -==== Running Elasticsearch from the command line - -Once installed, Elasticsearch can be started from the command line, if not installed as a service -and configured to start when installation completes, as follows: - -["source","sh",subs="attributes,callouts"] --------------------------------------------- -.\bin\elasticsearch.exe --------------------------------------------- - -The command line terminal will display output similar to the following: - -[[msi-installer-elasticsearch-exe]] -image::images/msi_installer/elasticsearch_exe.png[] - -By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT` in addition -to the `.log` file within `LOGSDIRECTORY`, and can be stopped by pressing `Ctrl-C`. +include::msi-windows-start.asciidoc[] [[msi-installer-command-line-configuration]] ==== Configuring Elasticsearch on the command line diff --git a/docs/reference/setup/install/zip-targz-daemon.asciidoc b/docs/reference/setup/install/zip-targz-daemon.asciidoc new file mode 100644 index 0000000000000..31d9c3c2e7437 --- /dev/null +++ b/docs/reference/setup/install/zip-targz-daemon.asciidoc @@ -0,0 +1,21 @@ +==== Running as a daemon + +To run Elasticsearch as a daemon, specify `-d` on the command line, and record +the process ID in a file using the `-p` option: + +[source,sh] +-------------------------------------------- +./bin/elasticsearch -d -p pid +-------------------------------------------- + +Log messages can be found in the `$ES_HOME/logs/` directory. + +To shut down Elasticsearch, kill the process ID recorded in the `pid` file: + +[source,sh] +-------------------------------------------- +kill `cat pid` +-------------------------------------------- + +NOTE: The startup scripts provided in the <> and <> +packages take care of starting and stopping the Elasticsearch process for you. diff --git a/docs/reference/setup/install/zip-targz-start.asciidoc b/docs/reference/setup/install/zip-targz-start.asciidoc new file mode 100644 index 0000000000000..907b2a7317d79 --- /dev/null +++ b/docs/reference/setup/install/zip-targz-start.asciidoc @@ -0,0 +1,17 @@ +==== Running Elasticsearch from the command line + +Elasticsearch can be started from the command line as follows: + +[source,sh] +-------------------------------------------- +./bin/elasticsearch +-------------------------------------------- + +By default, Elasticsearch runs in the foreground, prints its logs to the +standard output (`stdout`), and can be stopped by pressing `Ctrl-C`. + +NOTE: All scripts packaged with Elasticsearch require a version of Bash +that supports arrays and assume that Bash is available at `/bin/bash`. +As such, Bash should be available at this path either directly or via a +symbolic link. + diff --git a/docs/reference/setup/install/zip-targz.asciidoc b/docs/reference/setup/install/zip-targz.asciidoc index f44742c648e8e..735ca5b4ea0d1 100644 --- a/docs/reference/setup/install/zip-targz.asciidoc +++ b/docs/reference/setup/install/zip-targz.asciidoc @@ -90,22 +90,7 @@ include::xpack-indices.asciidoc[] endif::include-xpack[] [[zip-targz-running]] -==== Running Elasticsearch from the command line - -Elasticsearch can be started from the command line as follows: - -[source,sh] --------------------------------------------- -./bin/elasticsearch --------------------------------------------- - -By default, Elasticsearch runs in the foreground, prints its logs to the -standard output (`stdout`), and can be stopped by pressing `Ctrl-C`. - -NOTE: All scripts packaged with Elasticsearch require a version of Bash -that supports arrays and assume that Bash is available at `/bin/bash`. -As such, Bash should be available at this path either directly or via a -symbolic link. +include::zip-targz-start.asciidoc[] include::check-running.asciidoc[] @@ -113,27 +98,7 @@ Log printing to `stdout` can be disabled using the `-q` or `--quiet` option on the command line. [[setup-installation-daemon]] -==== Running as a daemon - -To run Elasticsearch as a daemon, specify `-d` on the command line, and record -the process ID in a file using the `-p` option: - -[source,sh] --------------------------------------------- -./bin/elasticsearch -d -p pid --------------------------------------------- - -Log messages can be found in the `$ES_HOME/logs/` directory. - -To shut down Elasticsearch, kill the process ID recorded in the `pid` file: - -[source,sh] --------------------------------------------- -kill `cat pid` --------------------------------------------- - -NOTE: The startup scripts provided in the <> and <> -packages take care of starting and stopping the Elasticsearch process for you. +include::zip-targz-daemon.asciidoc[] [[zip-targz-configuring]] ==== Configuring Elasticsearch on the command line diff --git a/docs/reference/setup/install/zip-windows-start.asciidoc b/docs/reference/setup/install/zip-windows-start.asciidoc new file mode 100644 index 0000000000000..7ecea449d2895 --- /dev/null +++ b/docs/reference/setup/install/zip-windows-start.asciidoc @@ -0,0 +1,11 @@ +==== Running Elasticsearch from the command line + +Elasticsearch can be started from the command line as follows: + +[source,sh] +-------------------------------------------- +.\bin\elasticsearch.bat +-------------------------------------------- + +By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT`, +and can be stopped by pressing `Ctrl-C`. diff --git a/docs/reference/setup/install/zip-windows.asciidoc b/docs/reference/setup/install/zip-windows.asciidoc index cd86a6268911c..254fb63f6157d 100644 --- a/docs/reference/setup/install/zip-windows.asciidoc +++ b/docs/reference/setup/install/zip-windows.asciidoc @@ -58,17 +58,7 @@ include::xpack-indices.asciidoc[] endif::include-xpack[] [[windows-running]] -==== Running Elasticsearch from the command line - -Elasticsearch can be started from the command line as follows: - -[source,sh] --------------------------------------------- -.\bin\elasticsearch.bat --------------------------------------------- - -By default, Elasticsearch runs in the foreground, prints its logs to `STDOUT`, -and can be stopped by pressing `Ctrl-C`. +include::zip-windows-start.asciidoc[] [[windows-configuring]] ==== Configuring Elasticsearch on the command line diff --git a/docs/reference/setup/starting.asciidoc b/docs/reference/setup/starting.asciidoc new file mode 100644 index 0000000000000..6fab871e7c9ca --- /dev/null +++ b/docs/reference/setup/starting.asciidoc @@ -0,0 +1,72 @@ +[[starting-elasticsearch]] +== Starting Elasticsearch + +The method for starting {es} varies depending on how you installed it. + +[float] +[[start-targz]] +=== Archive packages (`.tar.gz`) + +If you installed {es} with a `.tar.gz` package, you can start {es} from the +command line. + +[float] +include::install/zip-targz-start.asciidoc[] + +[float] +include::install/zip-targz-daemon.asciidoc[] + +[float] +[[start-zip]] +=== Archive packages (`.zip`) + +If you installed {es} on Windows with a `.zip` package, you can start {es} from +the command line. If you want {es} to start automatically at boot time without +any user interaction, <>. + +[float] +include::install/zip-windows-start.asciidoc[] + +[float] +[[start-deb]] +=== Debian packages + +include::install/init-systemd.asciidoc[] + +[float] +include::install/deb-init.asciidoc[] + +[float] +include::install/systemd.asciidoc[] + +[float] +[[start-docker]] +=== Docker images + +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 <>. + +[float] +[[start-msi]] +=== MSI packages + +If you installed {es} on Windows using the `.msi` package, you can start {es} +from the command line. If you want it to start automatically at boot time +without any user interaction, +<>. + +[float] +include::install/msi-windows-start.asciidoc[] + +[float] +[[start-rpm]] +=== RPM packages + +include::install/init-systemd.asciidoc[] + +[float] +include::install/rpm-init.asciidoc[] + +[float] +include::install/systemd.asciidoc[] \ No newline at end of file