windows.asciidoc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. [[windows]]
  2. === Install Elasticsearch with Windows MSI Installer
  3. beta[]
  4. Elasticsearch can be installed on Windows using the `.msi` package. This can
  5. install Elasticsearch as a Windows service or allow it to be run manually using
  6. the included `elasticsearch.exe` executable.
  7. TIP: Elasticsearch has historically been installed on Windows using the <<zip-windows, .zip>> archive.
  8. You can continue using the `.zip` approach if you prefer.
  9. include::license.asciidoc[]
  10. NOTE: On Windows the Elasticsearch {ml} feature requires the Microsoft Universal
  11. C Runtime library. This is built into Windows 10, Windows Server 2016 and more
  12. recent versions of Windows. For older versions of Windows it can be installed
  13. via Windows Update, or from a
  14. https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows[separate download].
  15. If you cannot install the Microsoft Universal C Runtime library you can still
  16. use the rest of Elasticsearch if you disable the {ml} feature.
  17. The latest stable version of Elasticsearch can be found on the
  18. link:/downloads/elasticsearch[Download Elasticsearch] page.
  19. Other versions can be found on the
  20. link:/downloads/past-releases[Past Releases page].
  21. NOTE: Elasticsearch includes a bundled version of https://openjdk.java.net[OpenJDK]
  22. from the JDK maintainers (GPLv2+CE). To use your own version of Java,
  23. see the <<jvm-version, JVM version requirements>>
  24. [[download-msi]]
  25. ==== Download the `.msi` package
  26. ifeval::["{release-state}"=="unreleased"]
  27. Version {version} of Elasticsearch has not yet been released.
  28. endif::[]
  29. ifeval::["{release-state}"!="unreleased"]
  30. Download the `.msi` package for Elasticsearch v{version} from https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.msi
  31. endif::[]
  32. [[install-msi-gui]]
  33. ==== Install using the graphical user interface (GUI)
  34. Double-click the downloaded `.msi` package to launch a GUI wizard that will guide you through the
  35. installation process. You can view help on any step by clicking the `?` button, which reveals an
  36. aside panel with additional information for each input:
  37. [[msi-installer-help]]
  38. image::images/msi_installer/msi_installer_help.png[]
  39. Within the first screen, select the directory for the installation. In addition, select directories for where
  40. data, logs and configuration will be placed or <<msi-command-line-options,use the default locations>>:
  41. [[msi-installer-locations]]
  42. image::images/msi_installer/msi_installer_locations.png[]
  43. Then select whether to install as a service or start Elasticsearch manually as needed. When
  44. installing as a service, you can also configure the Windows account to run the service with,
  45. whether the service should be started after installation and the Windows startup behaviour:
  46. [[msi-installer-service]]
  47. image::images/msi_installer/msi_installer_service.png[]
  48. IMPORTANT: When selecting a Windows account to run the service with, be sure that the chosen account
  49. has sufficient privileges to access the installation and other deployment directories chosen. Also
  50. ensure the account is able to run Windows services.
  51. Common configuration settings are exposed within the Configuration section, allowing the cluster
  52. name, node name and roles to be set, in addition to memory and network settings:
  53. [[msi-installer-configuration]]
  54. image::images/msi_installer/msi_installer_configuration.png[]
  55. 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.
  56. 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`:
  57. [[msi-installer-selected-plugins]]
  58. image::images/msi_installer/msi_installer_selected_plugins.png[]
  59. As of version 6.3.0, {xpack} is now https://www.elastic.co/products/x-pack/open[bundled by default].
  60. The final step allows a choice of the type of license to install, in addition to
  61. security configuration and built-in user configuration:
  62. [[msi-installer-xpack]]
  63. image::images/msi_installer/msi_installer_xpack.png[]
  64. After clicking the install button, the installation will begin:
  65. [[msi-installer-installing]]
  66. image::images/msi_installer/msi_installer_installing.png[]
  67. ...and will indicate when it has been successfully installed:
  68. [[msi-installer-success]]
  69. image::images/msi_installer/msi_installer_success.png[]
  70. [[install-msi-command-line]]
  71. ==== Install using the command line
  72. The `.msi` can also install Elasticsearch using the command line. The simplest installation
  73. using the same defaults as the GUI is achieved by first navigating to the download directory,
  74. then running:
  75. ["source","sh",subs="attributes,callouts"]
  76. --------------------------------------------
  77. msiexec.exe /i elasticsearch-{version}.msi /qn
  78. --------------------------------------------
  79. By default, `msiexec.exe` does not wait for the installation process to complete, since it runs in the
  80. Windows subsystem. To wait on the process to finish and ensure that `%ERRORLEVEL%` is set
  81. accordingly, it is recommended to use `start /wait` to create a process and wait for it to exit
  82. ["source","sh",subs="attributes,callouts"]
  83. --------------------------------------------
  84. start /wait msiexec.exe /i elasticsearch-{version}.msi /qn
  85. --------------------------------------------
  86. As with any MSI installation package, a log file for the installation process can be found
  87. within the `%TEMP%` directory, with a randomly generated name adhering to the format
  88. `MSI<random>.LOG`. The path to a log file can be supplied using the `/l` command line argument
  89. ["source","sh",subs="attributes,callouts"]
  90. --------------------------------------------
  91. start /wait msiexec.exe /i elasticsearch-{version}.msi /qn /l install.log
  92. --------------------------------------------
  93. Supported Windows Installer command line arguments can be viewed using
  94. ["source","sh",subs="attributes,callouts"]
  95. --------------------------------------------
  96. msiexec.exe /help
  97. --------------------------------------------
  98. ...or by consulting the https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx[Windows Installer SDK Command-Line Options].
  99. [[msi-command-line-options]]
  100. ==== Command line options
  101. All settings exposed within the GUI are also available as command line arguments (referred to
  102. as _properties_ within Windows Installer documentation) that can be passed to `msiexec.exe`:
  103. [horizontal]
  104. `INSTALLDIR`::
  105. The installation directory. The final directory in the path **must**
  106. be the version of Elasticsearch.
  107. Defaults to ++%ProgramW6432%\Elastic\Elasticsearch{backslash}{version}++.
  108. `DATADIRECTORY`::
  109. The directory in which to store your data.
  110. Defaults to `%ALLUSERSPROFILE%\Elastic\Elasticsearch\data`
  111. `CONFIGDIRECTORY`::
  112. The directory in which to store your configuration.
  113. Defaults to `%ALLUSERSPROFILE%\Elastic\Elasticsearch\config`
  114. `LOGSDIRECTORY`::
  115. The directory in which to store your logs.
  116. Defaults to `%ALLUSERSPROFILE%\Elastic\Elasticsearch\logs`
  117. `PLACEWRITABLELOCATIONSINSAMEPATH`::
  118. Whether the data, configuration and logs directories
  119. should be created under the installation directory. Defaults to `false`
  120. `INSTALLASSERVICE`::
  121. Whether Elasticsearch is installed and configured as a Windows Service.
  122. Defaults to `true`
  123. `STARTAFTERINSTALL`::
  124. Whether the Windows Service is started after installation finishes.
  125. Defaults to `true`
  126. `STARTWHENWINDOWSSTARTS`::
  127. Whether the Windows Service is started when Windows is started.
  128. Defaults to `true`
  129. `USELOCALSYSTEM`::
  130. Whether the Windows service runs under the LocalSystem Account.
  131. Defaults to `true`
  132. `USENETWORKSERVICE`::
  133. Whether the Windows service runs under the NetworkService Account. Defaults
  134. to `false`
  135. `USEEXISTINGUSER`::
  136. Whether the Windows service runs under a specified existing account. Defaults
  137. to `false`
  138. `USER`::
  139. The username for the account under which the Windows service runs. Defaults to `""`
  140. `PASSWORD`::
  141. The password for the account under which the Windows service runs. Defaults to `""`
  142. `CLUSTERNAME`::
  143. The name of the cluster. Defaults to `elasticsearch`
  144. `NODENAME`::
  145. The name of the node. Defaults to `%COMPUTERNAME%`
  146. `MASTERNODE`::
  147. Whether Elasticsearch is configured as a master node. Defaults to `true`
  148. `DATANODE`::
  149. Whether Elasticsearch is configured as a data node. Defaults to `true`
  150. `INGESTNODE`::
  151. Whether Elasticsearch is configured as an ingest node. Defaults to `true`
  152. `SELECTEDMEMORY`::
  153. The amount of memory to allocate to the JVM heap for Elasticsearch.
  154. Defaults to `2048` unless the target machine has less than 4GB in total, in which case
  155. it defaults to 50% of total memory.
  156. `LOCKMEMORY`::
  157. Whether `bootstrap.memory_lock` should be used to try to lock the process
  158. address space into RAM. Defaults to `false`
  159. `UNICASTNODES`::
  160. A comma separated list of hosts in the form `host:port` or `host` to be used for
  161. unicast discovery. Defaults to `""`
  162. `MINIMUMMASTERNODES`::
  163. The minimum number of master-eligible nodes that must be visible
  164. in order to form a cluster. Defaults to `""`
  165. `NETWORKHOST`::
  166. The hostname or IP address to bind the node to and _publish_ (advertise) this
  167. host to other nodes in the cluster. Defaults to `""`
  168. `HTTPPORT`::
  169. The port to use for exposing Elasticsearch APIs over HTTP. Defaults to `9200`
  170. `TRANSPORTPORT`::
  171. The port to use for internal communication between nodes within the cluster.
  172. Defaults to `9300`
  173. `PLUGINS`::
  174. A comma separated list of the plugins to download and install as part of the
  175. installation. Defaults to `""`
  176. `HTTPSPROXYHOST`::
  177. The proxy host to use to download plugins over HTTPS. Defaults to `""`
  178. `HTTPSPROXYPORT`::
  179. The proxy port to use to download plugins over HTTPS. Defaults to `443`
  180. `HTTPPROXYHOST`::
  181. The proxy host to use to download plugins over HTTP. Defaults to `""`
  182. `HTTPPROXYPORT`::
  183. The proxy port to use to download plugins over HTTP. Defaults to `80`
  184. `XPACKLICENSE`::
  185. The type of license to install, either `Basic` or `Trial`. Defaults to `Basic`
  186. `XPACKSECURITYENABLED`::
  187. When installing with a `Trial` license, whether {security-features} are
  188. enabled. Defaults to `true`
  189. `BOOTSTRAPPASSWORD`::
  190. When installing with a `Trial` license and {security-features} are enabled,
  191. the password to used to bootstrap the cluster and persisted as the
  192. `bootstrap.password` setting in the keystore. Defaults to a randomized value.
  193. `SKIPSETTINGPASSWORDS`::
  194. When installing with a `Trial` license and {security-features} enabled,
  195. whether the installation should skip setting up the built-in users.
  196. Defaults to `false`
  197. `ELASTICUSERPASSWORD`::
  198. When installing with a `Trial` license and {security-features} are enabled,
  199. the password to use for the built-in user `elastic`. Defaults to `""`
  200. `KIBANAUSERPASSWORD`::
  201. When installing with a `Trial` license and {security-features} are enabled,
  202. the password to use for the built-in user `kibana`. Defaults to `""`
  203. `LOGSTASHSYSTEMUSERPASSWORD`::
  204. When installing with a `Trial` license and {security-features} are enabled,
  205. the password to use for the built-in user `logstash_system`. Defaults to `""`
  206. To pass a value, simply append the property name and value using the format
  207. `<PROPERTYNAME>="<VALUE>"` to the installation command. For example, to use a
  208. different installation directory to the default one:
  209. ["source","sh",subs="attributes,callouts"]
  210. --------------------------------------------
  211. start /wait msiexec.exe /i elasticsearch-{version}.msi /qn INSTALLDIR="C:\Custom Install Directory\{version}"
  212. --------------------------------------------
  213. Consult the https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx[Windows Installer SDK Command-Line Options]
  214. for additional rules related to values containing quotation marks.
  215. ifdef::include-xpack[]
  216. [role="xpack"]
  217. [[msi-installer-enable-indices]]
  218. ==== Enable automatic creation of system indices
  219. include::xpack-indices.asciidoc[]
  220. endif::include-xpack[]
  221. [[msi-installer-command-line-running]]
  222. include::msi-windows-start.asciidoc[]
  223. [[msi-installer-command-line-configuration]]
  224. ==== Configuring Elasticsearch on the command line
  225. Elasticsearch loads its configuration from the `%ES_PATH_CONF%\elasticsearch.yml`
  226. file by default. The format of this config file is explained in
  227. <<settings>>.
  228. Any settings that can be specified in the config file can also be specified on
  229. the command line, using the `-E` syntax as follows:
  230. ["source","sh",subs="attributes,callouts"]
  231. --------------------------------------------
  232. .\bin\elasticsearch.exe -E cluster.name=my_cluster -E node.name=node_1
  233. --------------------------------------------
  234. NOTE: Values that contain spaces must be surrounded with quotes. For instance `-E path.logs="C:\My Logs\logs"`.
  235. TIP: Typically, any cluster-wide settings (like `cluster.name`) should be
  236. added to the `elasticsearch.yml` config file, while any node-specific settings
  237. such as `node.name` could be specified on the command line.
  238. include::check-running.asciidoc[]
  239. [[msi-installer-windows-service]]
  240. ==== Installing Elasticsearch as a Service on Windows
  241. Elasticsearch can be installed as a service to run in the background or start
  242. automatically at boot time without any user interaction. This can be achieved upon installation
  243. using the following command line options
  244. * `INSTALLASSERVICE=true`
  245. * `STARTAFTERINSTALL=true`
  246. * `STARTWHENWINDOWSSTARTS=true`
  247. Once installed, Elasticsearch will appear within the Services control panel:
  248. [[msi-installer-installed-service]]
  249. image::images/msi_installer/msi_installer_installed_service.png[]
  250. and can be stopped and restarted from within the control panel, or from the command line using:
  251. with Command Prompt:
  252. [source,sh]
  253. --------------------------------------------
  254. sc.exe stop Elasticsearch
  255. sc.exe start Elasticsearch
  256. --------------------------------------------
  257. with PowerShell:
  258. [source,powershell]
  259. --------------------------------------------
  260. Get-Service Elasticsearch | Stop-Service
  261. Get-Service Elasticsearch | Start-Service
  262. --------------------------------------------
  263. Changes can be made to `jvm.options` and `elasticsearch.yml` configuration files to configure the
  264. service after installation. Most changes (like JVM settings) will require a restart of the
  265. service in order to take effect.
  266. [[upgrade-msi-gui]]
  267. ==== Upgrade using the graphical user interface (GUI)
  268. The `.msi` package supports upgrading an installed version of Elasticsearch to a newer
  269. version. The upgrade process through the GUI handles upgrading all
  270. installed plugins as well as retaining both your data and configuration.
  271. Downloading and double-clicking on a newer version of the `.msi` package will launch the GUI wizard.
  272. The first step will list the read-only properties from the previous installation:
  273. [[msi-installer-upgrade-notice]]
  274. image::images/msi_installer/msi_installer_upgrade_notice.png[]
  275. The next step allows certain configuration options to be changed:
  276. [[msi-installer-upgrade-configuration]]
  277. image::images/msi_installer/msi_installer_upgrade_configuration.png[]
  278. Finally, the plugins step allows currently installed plugins to be upgraded or removed, and
  279. for plugins not currently installed, to be downloaded and installed:
  280. [[msi-installer-upgrade-plugins]]
  281. image::images/msi_installer/msi_installer_upgrade_plugins.png[]
  282. [[upgrade-msi-command-line]]
  283. ==== Upgrade using the command line
  284. The `.msi` can also upgrade Elasticsearch using the command line.
  285. [IMPORTANT]
  286. ===========================================
  287. A command line upgrade requires passing the **same** command line properties as
  288. used at first install time; the Windows Installer does not remember these properties.
  289. For example, if you originally installed with the command line options `PLUGINS="ingest-geoip"` and
  290. `LOCKMEMORY="true"`, then you must pass these same values when performing an
  291. upgrade from the command line.
  292. The **exception** to this is the `INSTALLDIR` parameter (if originally specified), which must be a different directory to the
  293. current installation.
  294. If setting `INSTALLDIR`, the final directory in the path **must** be the version of Elasticsearch e.g.
  295. ++C:\Program Files\Elastic\Elasticsearch{backslash}{version}++
  296. ===========================================
  297. The simplest upgrade, assuming Elasticsearch was installed using all defaults,
  298. is achieved by first navigating to the download directory, then running:
  299. ["source","sh",subs="attributes,callouts"]
  300. --------------------------------------------
  301. start /wait msiexec.exe /i elasticsearch-{version}.msi /qn
  302. --------------------------------------------
  303. Similar to the install process, a path to a log file for the upgrade process can
  304. be passed using the `/l` command line argument
  305. ["source","sh",subs="attributes,callouts"]
  306. --------------------------------------------
  307. start /wait msiexec.exe /i elasticsearch-{version}.msi /qn /l upgrade.log
  308. --------------------------------------------
  309. [[uninstall-msi-gui]]
  310. ==== Uninstall using Add/Remove Programs
  311. The `.msi` package handles uninstallation of all directories and files added as part of installation.
  312. WARNING: Uninstallation will remove **all** contents created as part of
  313. installation, **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.
  314. MSI installer packages do not provide a GUI for uninstallation. An installed program can be uninstalled
  315. by pressing the Windows key and typing `add or remove programs` to open the system settings.
  316. Once opened, find the Elasticsearch installation within the list of installed applications, click
  317. and choose `Uninstall`:
  318. [[msi-installer-uninstall]]
  319. image::images/msi_installer/msi_installer_uninstall.png[]
  320. This will launch the uninstallation process.
  321. [[uninstall-msi-command-line]]
  322. ==== Uninstall using the command line
  323. Uninstallation can also be performed from the command line by navigating to the directory
  324. containing the `.msi` package and running:
  325. ["source","sh",subs="attributes,callouts"]
  326. --------------------------------------------
  327. start /wait msiexec.exe /x elasticsearch-{version}.msi /qn
  328. --------------------------------------------
  329. Similar to the install process, a path to a log file for the uninstallation process can
  330. be passed using the `/l` command line argument
  331. ["source","sh",subs="attributes,callouts"]
  332. --------------------------------------------
  333. start /wait msiexec.exe /x elasticsearch-{version}.msi /qn /l uninstall.log
  334. --------------------------------------------
  335. include::next-steps.asciidoc[]