windows.asciidoc 19 KB

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