2013-08-28 19:24:34 -04:00
|
|
|
[[setup]]
|
|
|
|
= Setup
|
|
|
|
|
|
|
|
[partintro]
|
|
|
|
--
|
|
|
|
This section includes information on how to setup *elasticsearch* and
|
2015-05-01 14:37:26 -04:00
|
|
|
get it running. If you haven't already, http://www.elastic.co/downloads[download] it, and
|
2013-08-28 19:24:34 -04:00
|
|
|
then check the <<setup-installation,installation>> docs.
|
|
|
|
|
2014-02-06 11:01:58 -05:00
|
|
|
NOTE: Elasticsearch can also be installed from our repositories using `apt` or `yum`.
|
|
|
|
See <<setup-repositories>>.
|
|
|
|
|
2015-10-09 06:27:05 -04:00
|
|
|
[[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.
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
[[setup-installation]]
|
|
|
|
[float]
|
|
|
|
== Installation
|
|
|
|
|
2015-05-24 11:57:34 -04:00
|
|
|
After link:/downloads/elasticsearch[downloading] the latest release and extracting it,
|
2013-08-28 19:24:34 -04:00
|
|
|
*elasticsearch* can be started using:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
--------------------------------------------------
|
|
|
|
$ bin/elasticsearch
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2015-05-24 11:57:34 -04:00
|
|
|
On *nix systems, the command will start the process in the foreground.
|
|
|
|
|
|
|
|
[[setup-installation-daemon]]
|
|
|
|
[float]
|
|
|
|
=== Running as a daemon
|
|
|
|
|
2013-12-15 14:29:11 -05:00
|
|
|
To run it in the background, add the `-d` switch to it:
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
--------------------------------------------------
|
2013-12-15 14:29:11 -05:00
|
|
|
$ bin/elasticsearch -d
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2015-05-24 11:57:34 -04:00
|
|
|
[[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.
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
.*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.
|
|
|
|
|
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 09:10:56 -04:00
|
|
|
Another feature is the ability to pass `-E` configuration parameters
|
|
|
|
directly to the script. For example:
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
--------------------------------------------------
|
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 09:10:56 -04:00
|
|
|
$ bin/elasticsearch -Ees.index.refresh_interval=5s -Ees.node.name=my-node
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
*************************************************************************
|
2014-09-11 05:13:19 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
[[jvm-version]]
|
2014-12-30 11:40:19 -05:00
|
|
|
== Java (JVM) version
|
2014-09-11 05:13:19 -04:00
|
|
|
|
|
|
|
Elasticsearch is built using Java, and requires at least
|
2015-09-22 08:23:30 -04:00
|
|
|
http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java 8] in
|
2014-09-11 05:15:42 -04:00
|
|
|
order to run. Only Oracle's Java and the OpenJDK are supported. The same JVM
|
2014-12-30 11:40:19 -05:00
|
|
|
version should be used on all Elasticsearch nodes and clients.
|
2014-09-11 05:13:19 -04:00
|
|
|
|
2015-09-22 08:23:30 -04:00
|
|
|
We recommend installing the *Java 8 update 20 or later*.
|
|
|
|
Elasticsearch will refuse to start if a known-bad version of Java is used.
|
2014-09-11 05:13:19 -04:00
|
|
|
|
|
|
|
The version of Java to use can be configured by setting the `JAVA_HOME`
|
|
|
|
environment variable.
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
--
|
|
|
|
|
|
|
|
include::setup/configuration.asciidoc[]
|
|
|
|
|
|
|
|
include::setup/as-a-service.asciidoc[]
|
|
|
|
|
2013-09-23 11:24:31 -04:00
|
|
|
include::setup/as-a-service-win.asciidoc[]
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
include::setup/dir-layout.asciidoc[]
|
|
|
|
|
2013-12-19 09:54:40 -05:00
|
|
|
include::setup/repositories.asciidoc[]
|
2014-04-01 12:28:08 -04:00
|
|
|
|
|
|
|
include::setup/upgrade.asciidoc[]
|