OpenSearch/docs/reference/setup.asciidoc
Jason Tedor 8a05c2a2be Bootstrap does not set system properties
Today, certain bootstrap properties are set and read via system
properties. This action-at-distance way of managing these properties is
rather confusing, and completely unnecessary. But another problem exists
with setting these as system properties. Namely, these system properties
are interpreted as Elasticsearch settings, not all of which are
registered. This leads to Elasticsearch failing to startup if any of
these special properties are set. Instead, these properties should be
kept as local as possible, and passed around as method parameters where
needed. This eliminates the action-at-distance way of handling these
properties, and eliminates the need to register these non-setting
properties. This commit does exactly that.

Additionally, today we use the "-D" command line flag to set the
properties, but this is confusing because "-D" is a special flag to the
JVM for setting system properties. This creates confusion because some
"-D" properties should be passed via arguments to the JVM (so via
ES_JAVA_OPTS), and some should be passed as arguments to
Elasticsearch. This commit changes the "-D" flag for Elasticsearch
settings to "-E".
2016-03-13 20:09:15 -04:00

107 lines
3.3 KiB
Plaintext

[[setup]]
= Setup
[partintro]
--
This section includes information on how to setup *elasticsearch* and
get it running. If you haven't already, http://www.elastic.co/downloads[download] it, and
then check the <<setup-installation,installation>> docs.
NOTE: Elasticsearch can also be installed from our repositories using `apt` or `yum`.
See <<setup-repositories>>.
[[supported-platforms]]
[float]
== Supported platforms
The matrix of officially supported operating systems and JVMs is available here:
link:/support/matrix[Support Matrix]. Elasticsearch is tested on the listed
platforms, but it is possible that it will work on other platforms too.
[[setup-installation]]
[float]
== Installation
After link:/downloads/elasticsearch[downloading] the latest release and extracting it,
*elasticsearch* can be started using:
[source,sh]
--------------------------------------------------
$ bin/elasticsearch
--------------------------------------------------
On *nix systems, the command will start the process in the foreground.
[[setup-installation-daemon]]
[float]
=== Running as a daemon
To run it in the background, add the `-d` switch to it:
[source,sh]
--------------------------------------------------
$ bin/elasticsearch -d
--------------------------------------------------
[[setup-installation-pid]]
[float]
=== PID
The Elasticsearch process can write its PID to a specified file on startup,
making it easy to shut down the process later on:
[source,sh]
--------------------------------------------------
$ bin/elasticsearch -d -p pid <1>
$ kill `cat pid` <2>
--------------------------------------------------
<1> The PID is written to a file called `pid`.
<2> The `kill` command sends a `TERM` signal to the PID stored in the `pid` file.
NOTE: The startup scripts provided for <<setup-service,Linux>> and <<setup-service-win,Windows>>
take care of starting and stopping the Elasticsearch process for you.
.*NIX
*************************************************************************
There are added features when using the `elasticsearch` shell script.
The first, which was explained earlier, is the ability to easily run the
process either in the foreground or the background.
Another feature is the ability to pass `-E` configuration parameters
directly to the script. For example:
[source,sh]
--------------------------------------------------
$ bin/elasticsearch -Ees.index.refresh_interval=5s -Ees.node.name=my-node
--------------------------------------------------
*************************************************************************
[float]
[[jvm-version]]
== Java (JVM) version
Elasticsearch is built using Java, and requires at least
http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java 8] in
order to run. Only Oracle's Java and the OpenJDK are supported. The same JVM
version should be used on all Elasticsearch nodes and clients.
We recommend installing the *Java 8 update 20 or later*.
Elasticsearch will refuse to start if a known-bad version of Java is used.
The version of Java to use can be configured by setting the `JAVA_HOME`
environment variable.
--
include::setup/configuration.asciidoc[]
include::setup/as-a-service.asciidoc[]
include::setup/as-a-service-win.asciidoc[]
include::setup/dir-layout.asciidoc[]
include::setup/repositories.asciidoc[]
include::setup/upgrade.asciidoc[]