NOTE: While a JRE can be used for the Elasticsearch service, due to its use of a client VM (as opposed to a server JVM which offers better performance for long-running applications) its usage is discouraged and a warning will be issued.
NOTE: The system environment variable `JAVA_HOME` should be set to the path to
the JDK installation that you want the service to use. If you upgrade the JDK,
you are not required to the reinstall the service but you must set the value of
the system environment variable `JAVA_HOME` to the path to the new JDK
installation. However, upgrading across JVM types (e.g. JRE versus SE) is not
supported, and does require the service to be reinstalled.
[[windows-service-settings]]
[float]
=== Customizing service settings
The Elasticsearch service can be configured prior to installation by setting the following environment variables (either using the https://technet.microsoft.com/en-us/library/cc754250(v=ws.10).aspx[set command] from the command line, or through the `System Properties->Environment Variables` GUI).
[horizontal]
`SERVICE_ID`::
A unique identifier for the service. Useful if installing multiple instances on the same machine. Defaults to `elasticsearch-service-x86` (on 32-bit Windows) or `elasticsearch-service-x64` (on 64-bit Windows).
`SERVICE_USERNAME`::
The user to run as, defaults to the local system account.
`SERVICE_PASSWORD`::
The password for the user specified in `%SERVICE_USERNAME%`.
`SERVICE_DISPLAY_NAME`::
The name of the service. Defaults to `Elasticsearch <version> %SERVICE_ID%`.
`SERVICE_DESCRIPTION`::
The description of the service. Defaults to `Elasticsearch <version> Windows Service - https://elastic.co`.
`JAVA_HOME`::
The installation directory of the desired JVM to run the service under.
Configuration file directory (which needs to include `elasticsearch.yml`
and `log4j2.properties` files), defaults to `%ES_HOME%\conf`.
`ES_JAVA_OPTS`::
Any additional JVM system properties you may want to apply.
`ES_START_TYPE`::
Startup mode for the service. Can be either `auto` or `manual` (default).
`ES_STOP_TIMEOUT` ::
The timeout in seconds that procrun waits for service to exit gracefully. Defaults to `0`.
NOTE: At its core, `elasticsearch-service.bat` relies on http://commons.apache.org/proper/commons-daemon/[Apache Commons Daemon] project
to install the service. Environment variables set prior to the service installation are copied and will be used during the service lifecycle. This means any changes made to them after the installation will not be picked up unless the service is reinstalled.
NOTE: On Windows, the <<heap-size,heap size>> can be configured as for
any other Elasticsearch installation when running Elasticsearch from the
command line, or when installing Elasticsearch as a service for the
first time. To adjust the heap size for an already installed service,
use the service manager: `bin\elasticsearch-service.bat manager`.
Using the Manager GUI::
It is also possible to configure the service after it's been installed using the manager GUI (`elasticsearch-service-mgr.exe`), which offers insight into the installed service, including its status, startup type, JVM, start and stop settings amongst other things. Simply invoking `elasticsearch-service.bat manager` from the command-line will open up the manager window:
image::images/service-manager-win.png["Windows Service Manager GUI",align="center"]
Most changes (like JVM settings) made through the manager GUI will require a restart of the service in order to take affect.
[[windows-layout]]
==== Directory layout of `.zip` archive
The `.zip` package is entirely self-contained. All files and directories are,
by default, contained within `%ES_HOME%` -- the directory created when
unpacking the archive.
This is very convenient because you don't have to create any directories to
start using Elasticsearch, and uninstalling Elasticsearch is as easy as
removing the `%ES_HOME%` directory. However, it is advisable to change the
default locations of the config directory, the data directory, and the logs
directory so that you do not delete important data later on.
| Binary scripts including `elasticsearch` to start a node
and `elasticsearch-plugin` to install plugins
| %ES_HOME%\bin
d|
| conf
| Configuration files including `elasticsearch.yml`
| %ES_HOME%\config
| path.conf
| data
| The location of the data files of each index / shard allocated
on the node. Can hold multiple locations.
| %ES_HOME%\data
| path.data
| logs
| Log files location.
| %ES_HOME%\logs
| path.logs
| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| %ES_HOME%\plugins
|
| repo
| Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here.