| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510 | [[windows]]=== Install Elasticsearch with Windows MSI Installerbeta[]Elasticsearch can be installed on Windows using the `.msi` package.  This caninstall Elasticsearch as a Windows service or allow it to be run manually usingthe included `elasticsearch.exe` executable.TIP: Elasticsearch has historically been installed on Windows using the <<zip-windows, .zip>> archive.You can continue using the `.zip` approach if you prefer.include::license.asciidoc[]NOTE: On Windows the Elasticsearch {ml} feature requires the Microsoft UniversalC Runtime library. This is built into Windows 10, Windows Server 2016 and morerecent versions of Windows. For older versions of Windows it can be installedvia Windows Update, or from ahttps://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows[separate download].If you cannot install the Microsoft Universal C Runtime library you can stilluse the rest of Elasticsearch if you disable the {ml} feature.The latest stable version of Elasticsearch can be found on thelink:/downloads/elasticsearch[Download Elasticsearch] page.Other versions can be found on thelink:/downloads/past-releases[Past Releases page].NOTE: Elasticsearch includes a bundled version of https://openjdk.java.net[OpenJDK]from the JDK maintainers (GPLv2+CE). To use your own version of Java,see the <<jvm-version, JVM version requirements>>[[download-msi]]==== Download the `.msi` packageifeval::["{release-state}"=="unreleased"]Version {version} of Elasticsearch has not yet been released.endif::[]ifeval::["{release-state}"!="unreleased"]Download the `.msi` package for Elasticsearch v{version} from https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.msiendif::[][[install-msi-gui]]==== Install using the graphical user interface (GUI)Double-click the downloaded `.msi` package to launch a GUI wizard that will guide you through theinstallation process. You can view help on any step by clicking the `?` button, which reveals anaside panel with additional information for each input:[[msi-installer-help]]image::images/msi_installer/msi_installer_help.png[]Within the first screen, select the directory for the installation. In addition, select directories for wheredata, logs and configuration will be placed or <<msi-command-line-options,use the default locations>>:[[msi-installer-locations]]image::images/msi_installer/msi_installer_locations.png[]Then select whether to install as a service or start Elasticsearch manually as needed. Wheninstalling as a service, you can also configure the Windows account to run the service with,whether the service should be started after installation and the Windows startup behaviour:[[msi-installer-service]]image::images/msi_installer/msi_installer_service.png[]IMPORTANT: When selecting a Windows account to run the service with, be sure that the chosen accounthas sufficient privileges to access the installation and other deployment directories chosen. Alsoensure the account is able to run Windows services.Common configuration settings are exposed within the Configuration section, allowing the clustername, node name and roles to be set, in addition to memory and network settings:[[msi-installer-configuration]]image::images/msi_installer/msi_installer_configuration.png[]A list of common plugins that can be downloaded and installed as part of the installation, with the option to configure an HTTPS proxy through which to download these plugins.TIP: Ensure the installation machine has access to the internet and that any corporate firewalls in place are configured to allow downloads from `artifacts.elastic.co`:[[msi-installer-selected-plugins]]image::images/msi_installer/msi_installer_selected_plugins.png[]As of version 6.3.0, {xpack} is now https://www.elastic.co/products/x-pack/open[bundled by default].The final step allows a choice of the type of license to install, in addition tosecurity configuration and built-in user configuration:[[msi-installer-xpack]]image::images/msi_installer/msi_installer_xpack.png[]After clicking the install button, the installation will begin:[[msi-installer-installing]]image::images/msi_installer/msi_installer_installing.png[]...and will indicate when it has been successfully installed:[[msi-installer-success]]image::images/msi_installer/msi_installer_success.png[][[install-msi-command-line]]==== Install using the command lineThe `.msi` can also install Elasticsearch using the command line. The simplest installationusing the same defaults as the GUI is achieved by first navigating to the download directory,then running:["source","sh",subs="attributes,callouts"]--------------------------------------------msiexec.exe /i elasticsearch-{version}.msi /qn--------------------------------------------By default, `msiexec.exe` does not wait for the installation process to complete, since it runs in theWindows subsystem. To wait on the process to finish and ensure that `%ERRORLEVEL%` is setaccordingly, it is recommended to use `start /wait` to create a process and wait for it to exit["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /i elasticsearch-{version}.msi /qn--------------------------------------------As with any MSI installation package, a log file for the installation process can be foundwithin the `%TEMP%` directory, with a randomly generated name adhering to the format`MSI<random>.LOG`. The path to a log file can be supplied using the `/l` command line argument["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /i elasticsearch-{version}.msi /qn /l install.log--------------------------------------------Supported Windows Installer command line arguments can be viewed using["source","sh",subs="attributes,callouts"]--------------------------------------------msiexec.exe /help--------------------------------------------...or by consulting the https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx[Windows Installer SDK Command-Line Options].[[msi-command-line-options]]==== Command line optionsAll settings exposed within the GUI are also available as command line arguments (referred toas _properties_ within Windows Installer documentation) that can be passed to `msiexec.exe`:[horizontal]`INSTALLDIR`::  The installation directory. The final directory in the path **must**  be the version of Elasticsearch.  Defaults to ++%ProgramW6432%\Elastic\Elasticsearch{backslash}{version}++.`DATADIRECTORY`::  The directory in which to store your data.  Defaults to `%ALLUSERSPROFILE%\Elastic\Elasticsearch\data``CONFIGDIRECTORY`::  The directory in which to store your configuration.  Defaults to `%ALLUSERSPROFILE%\Elastic\Elasticsearch\config``LOGSDIRECTORY`::  The directory in which to store your logs.  Defaults to `%ALLUSERSPROFILE%\Elastic\Elasticsearch\logs``PLACEWRITABLELOCATIONSINSAMEPATH`::  Whether the data, configuration and logs directories  should be created under the installation directory. Defaults to `false``INSTALLASSERVICE`::  Whether Elasticsearch is installed and configured as a Windows Service.  Defaults to `true``STARTAFTERINSTALL`::  Whether the Windows Service is started after installation finishes.  Defaults to `true``STARTWHENWINDOWSSTARTS`::  Whether the Windows Service is started when Windows is started.  Defaults to `true``USELOCALSYSTEM`::  Whether the Windows service runs under the LocalSystem Account.  Defaults to `true``USENETWORKSERVICE`::  Whether the Windows service runs under the NetworkService Account. Defaults  to `false``USEEXISTINGUSER`::  Whether the Windows service runs under a specified existing account. Defaults  to `false``USER`::  The username for the account under which the Windows service runs. Defaults to `""``PASSWORD`::  The password for the account under which the Windows service runs. Defaults to `""``CLUSTERNAME`::  The name of the cluster. Defaults to `elasticsearch``NODENAME`::  The name of the node. Defaults to `%COMPUTERNAME%``MASTERNODE`::  Whether Elasticsearch is configured as a master node. Defaults to `true``DATANODE`::  Whether Elasticsearch is configured as a data node. Defaults to `true``INGESTNODE`::  Whether Elasticsearch is configured as an ingest node. Defaults to `true``SELECTEDMEMORY`::  The amount of memory to allocate to the JVM heap for Elasticsearch.  Defaults to `2048` unless the target machine has less than 4GB in total, in which case  it defaults to 50% of total memory.`LOCKMEMORY`::  Whether `bootstrap.memory_lock` should be used to try to lock the process  address space into RAM. Defaults to `false``UNICASTNODES`::  A comma separated list of hosts in the form `host:port` or `host` to be used for  unicast discovery. Defaults to `""``MINIMUMMASTERNODES`::  The minimum number of master-eligible nodes that must be visible  in order to form a cluster. Defaults to `""``NETWORKHOST`::  The hostname or IP address to bind the node to and _publish_ (advertise) this  host to other nodes in the cluster. Defaults to `""``HTTPPORT`::  The port to use for exposing Elasticsearch APIs over HTTP. Defaults to `9200``TRANSPORTPORT`::  The port to use for internal communication between nodes within the cluster.  Defaults to `9300``PLUGINS`::  A comma separated list of the plugins to download and install as part of the  installation. Defaults to `""``HTTPSPROXYHOST`::  The proxy host to use to download plugins over HTTPS. Defaults to `""``HTTPSPROXYPORT`::  The proxy port to use to download plugins over HTTPS. Defaults to `443``HTTPPROXYHOST`::  The proxy host to use to download plugins over HTTP. Defaults to `""``HTTPPROXYPORT`::  The proxy port to use to download plugins over HTTP. Defaults to `80``XPACKLICENSE`::  The type of license to install, either `Basic` or `Trial`. Defaults to `Basic``XPACKSECURITYENABLED`::  When installing with a `Trial` license, whether {security-features} are  enabled. Defaults to `true``BOOTSTRAPPASSWORD`::  When installing with a `Trial` license and {security-features} are enabled,  the password to used to bootstrap the cluster and persisted as the  `bootstrap.password` setting in the keystore. Defaults to a randomized value.`SKIPSETTINGPASSWORDS`::  When installing with a `Trial` license and {security-features} enabled,  whether the installation should skip setting up the built-in users.  Defaults to `false``ELASTICUSERPASSWORD`::  When installing with a `Trial` license and {security-features} are enabled,  the password to use for the built-in user `elastic`. Defaults to `""``KIBANAUSERPASSWORD`::  When installing with a `Trial` license and {security-features} are enabled,  the password to use for the built-in user `kibana`. Defaults to `""``LOGSTASHSYSTEMUSERPASSWORD`::  When installing with a `Trial` license and {security-features} are enabled,  the password to use for the built-in user `logstash_system`. Defaults to `""`To pass a value, simply append the property name and value using the format`<PROPERTYNAME>="<VALUE>"` to the installation command. For example, to use adifferent installation directory to the default one:["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /i elasticsearch-{version}.msi /qn INSTALLDIR="C:\Custom Install Directory\{version}"--------------------------------------------Consult the https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx[Windows Installer SDK Command-Line Options]for additional rules related to values containing quotation marks.ifdef::include-xpack[][role="xpack"][[msi-installer-enable-indices]]==== Enable automatic creation of system indicesinclude::xpack-indices.asciidoc[]endif::include-xpack[][[msi-installer-command-line-running]]include::msi-windows-start.asciidoc[][[msi-installer-command-line-configuration]]==== Configuring Elasticsearch on the command lineElasticsearch loads its configuration from the `%ES_PATH_CONF%\elasticsearch.yml`file by default. The format of this config file is explained in<<settings>>.Any settings that can be specified in the config file can also be specified onthe command line, using the `-E` syntax as follows:["source","sh",subs="attributes,callouts"]--------------------------------------------.\bin\elasticsearch.exe -E cluster.name=my_cluster -E node.name=node_1--------------------------------------------NOTE: Values that contain spaces must be surrounded with quotes.  For instance `-E path.logs="C:\My Logs\logs"`.TIP: Typically, any cluster-wide settings (like `cluster.name`) should beadded to the `elasticsearch.yml` config file, while any node-specific settingssuch as `node.name` could be specified on the command line.include::check-running.asciidoc[][[msi-installer-windows-service]]==== Installing Elasticsearch as a Service on WindowsElasticsearch can be installed as a service to run in the background or startautomatically at boot time without any user interaction. This can be achieved upon installationusing the following command line options* `INSTALLASSERVICE=true`* `STARTAFTERINSTALL=true`* `STARTWHENWINDOWSSTARTS=true`Once installed, Elasticsearch will appear within the Services control panel:[[msi-installer-installed-service]]image::images/msi_installer/msi_installer_installed_service.png[]and can be stopped and restarted from within the control panel, or from the command line using:with Command Prompt:[source,sh]--------------------------------------------sc.exe stop Elasticsearchsc.exe start Elasticsearch--------------------------------------------with PowerShell:[source,powershell]--------------------------------------------Get-Service Elasticsearch | Stop-ServiceGet-Service Elasticsearch | Start-Service--------------------------------------------Changes can be made to `jvm.options` and `elasticsearch.yml` configuration files to configure theservice after installation. Most changes (like JVM settings) will require a restart of theservice in order to take effect.[[upgrade-msi-gui]]==== Upgrade using the graphical user interface (GUI)The `.msi` package supports upgrading an installed version of Elasticsearch to a newerversion. The upgrade process through the GUI handles upgrading allinstalled plugins as well as retaining both your data and configuration.Downloading and double-clicking on a newer version of the `.msi` package will launch the GUI wizard.The first step will list the read-only properties from the previous installation:[[msi-installer-upgrade-notice]]image::images/msi_installer/msi_installer_upgrade_notice.png[]The next step allows certain configuration options to be changed:[[msi-installer-upgrade-configuration]]image::images/msi_installer/msi_installer_upgrade_configuration.png[]Finally, the plugins step allows currently installed plugins to be upgraded or removed, andfor plugins not currently installed, to be downloaded and installed:[[msi-installer-upgrade-plugins]]image::images/msi_installer/msi_installer_upgrade_plugins.png[][[upgrade-msi-command-line]]==== Upgrade using the command lineThe `.msi` can also upgrade Elasticsearch using the command line.[IMPORTANT]===========================================A command line upgrade requires passing the **same** command line properties asused at first install time; the Windows Installer does not remember these properties.For example, if you originally installed with the command line options `PLUGINS="ingest-geoip"` and`LOCKMEMORY="true"`, then you must pass these same values when performing anupgrade from the command line.The **exception** to this is the `INSTALLDIR` parameter (if originally specified), which must be a different directory to thecurrent installation.If setting `INSTALLDIR`, the final directory in the path **must** be the version of Elasticsearch e.g.++C:\Program Files\Elastic\Elasticsearch{backslash}{version}++===========================================The simplest upgrade, assuming Elasticsearch was installed using all defaults,is achieved by first navigating to the download directory, then running:["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /i elasticsearch-{version}.msi /qn--------------------------------------------Similar to the install process, a path to a log file for the upgrade process canbe passed using the `/l` command line argument["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /i elasticsearch-{version}.msi /qn /l upgrade.log--------------------------------------------[[uninstall-msi-gui]]==== Uninstall using Add/Remove ProgramsThe `.msi` package handles uninstallation of all directories and files added as part of installation.WARNING: Uninstallation will remove **all** contents created as part ofinstallation, **except for data, config or logs directories**. It is recommended that you make a copy of your data directory before upgrading or consider using the snapshot API.MSI installer packages do not provide a GUI for uninstallation. An installed program can be uninstalledby pressing the Windows key and typing `add or remove programs` to open the system settings.Once opened, find the Elasticsearch installation within the list of installed applications, clickand choose `Uninstall`:[[msi-installer-uninstall]]image::images/msi_installer/msi_installer_uninstall.png[]This will launch the uninstallation process.[[uninstall-msi-command-line]]==== Uninstall using the command lineUninstallation can also be performed from the command line by navigating to the directorycontaining the `.msi` package and running:["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /x elasticsearch-{version}.msi /qn--------------------------------------------Similar to the install process, a path to a log file for the uninstallation process canbe passed using the `/l` command line argument["source","sh",subs="attributes,callouts"]--------------------------------------------start /wait msiexec.exe /x elasticsearch-{version}.msi /qn /l uninstall.log--------------------------------------------include::next-steps.asciidoc[]
 |