zip-targz.asciidoc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. [[zip-targz]]
  2. === Install Elasticsearch with `.zip` or `.tar.gz`
  3. Elasticsearch is provided as a `.zip` and as a `.tar.gz` package. These
  4. packages can be used to install Elasticsearch on any system and are the
  5. easiest package format to use when trying out Elasticsearch.
  6. The latest stable version of Elasticsearch can be found on the
  7. link:/downloads/elasticsearch[Download Elasticsearch] page.
  8. Other versions can be found on the
  9. link:/downloads/past-releases[Past Releases page].
  10. NOTE: Elasticsearch requires Java 8 or later. Use the
  11. http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution]
  12. or an open-source distribution such as http://openjdk.java.net[OpenJDK].
  13. [[install-zip]]
  14. ==== Download and install the `.zip` package
  15. ifeval::["{release-state}"=="unreleased"]
  16. Version {version} of Elasticsearch has not yet been released.
  17. endif::[]
  18. ifeval::["{release-state}"!="unreleased"]
  19. The `.zip` archive for Elasticsearch v{version} can be downloaded and installed as follows:
  20. ["source","sh",subs="attributes"]
  21. --------------------------------------------
  22. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip
  23. sha1sum elasticsearch-{version}.zip <1>
  24. unzip elasticsearch-{version}.zip
  25. cd elasticsearch-{version}/ <2>
  26. --------------------------------------------
  27. <1> Compare the SHA produced by `sha1sum` or `shasum` with the
  28. https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip.sha1[published SHA].
  29. <2> This directory is known as `$ES_HOME`.
  30. endif::[]
  31. [[install-targz]]
  32. ==== Download and install the `.tar.gz` package
  33. ifeval::["{release-state}"=="unreleased"]
  34. Version {version} of Elasticsearch has not yet been released.
  35. endif::[]
  36. ifeval::["{release-state}"!="unreleased"]
  37. The `.tar.gz` archive for Elasticsearch v{version} can be downloaded and installed as follows:
  38. ["source","sh",subs="attributes"]
  39. --------------------------------------------
  40. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.tar.gz
  41. sha1sum elasticsearch-{version}.tar.gz <1>
  42. tar -xzf elasticsearch-{version}.tar.gz
  43. cd elasticsearch-{version}/ <2>
  44. --------------------------------------------
  45. <1> Compare the SHA produced by `sha1sum` or `shasum` with the
  46. https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.tar.gz.sha1[published SHA].
  47. <2> This directory is known as `$ES_HOME`.
  48. endif::[]
  49. [[zip-targz-running]]
  50. ==== Running Elasticsearch from the command line
  51. Elasticsearch can be started from the command line as follows:
  52. [source,sh]
  53. --------------------------------------------
  54. ./bin/elasticsearch
  55. --------------------------------------------
  56. By default, Elasticsearch runs in the foreground, prints its logs to the
  57. standard output (`stdout`), and can be stopped by pressing `Ctrl-C`.
  58. NOTE: All scripts packaged with Elasticsearch require a version of Bash
  59. that supports arrays and assume that Bash is available at `/bin/bash`.
  60. As such, Bash should be available at this path either directly or via a
  61. symbolic link.
  62. include::check-running.asciidoc[]
  63. Log printing to `stdout` can be disabled using the `-q` or `--quiet`
  64. option on the command line.
  65. [[setup-installation-daemon]]
  66. ==== Running as a daemon
  67. To run Elasticsearch as a daemon, specify `-d` on the command line, and record
  68. the process ID in a file using the `-p` option:
  69. [source,sh]
  70. --------------------------------------------
  71. ./bin/elasticsearch -d -p pid
  72. --------------------------------------------
  73. Log messages can be found in the `$ES_HOME/logs/` directory.
  74. To shut down Elasticsearch, kill the process ID recorded in the `pid` file:
  75. [source,sh]
  76. --------------------------------------------
  77. kill `cat pid`
  78. --------------------------------------------
  79. NOTE: The startup scripts provided in the <<rpm,RPM>> and <<deb,Debian>>
  80. packages take care of starting and stopping the Elasticsearch process for you.
  81. [[zip-targz-configuring]]
  82. ==== Configuring Elasticsearch on the command line
  83. Elasticsearch loads its configuration from the `$ES_HOME/config/elasticsearch.yml`
  84. file by default. The format of this config file is explained in
  85. <<settings>>.
  86. Any settings that can be specified in the config file can also be specified on
  87. the command line, using the `-E` syntax as follows:
  88. [source,sh]
  89. --------------------------------------------
  90. ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
  91. --------------------------------------------
  92. TIP: Typically, any cluster-wide settings (like `cluster.name`) should be
  93. added to the `elasticsearch.yml` config file, while any node-specific settings
  94. such as `node.name` could be specified on the command line.
  95. [[zip-targz-layout]]
  96. ==== Directory layout of `.zip` and `.tar.gz` archives
  97. The `.zip` and `.tar.gz` packages are entirely self-contained. All files and
  98. directories are, by default, contained within `$ES_HOME` -- the directory
  99. created when unpacking the archive.
  100. This is very convenient because you don't have to create any directories to
  101. start using Elasticsearch, and uninstalling Elasticsearch is as easy as
  102. removing the `$ES_HOME` directory. However, it is advisable to change the
  103. default locations of the config directory, the data directory, and the logs
  104. directory so that you do not delete important data later on.
  105. [cols="<h,<,<m,<m",options="header",]
  106. |=======================================================================
  107. | Type | Description | Default Location | Setting
  108. | home
  109. | Elasticsearch home directory or `$ES_HOME`
  110. d| Directory created by unpacking the archive
  111. |
  112. | bin
  113. | Binary scripts including `elasticsearch` to start a node
  114. and `elasticsearch-plugin` to install plugins
  115. | $ES_HOME/bin
  116. d|
  117. | conf
  118. | Configuration files including `elasticsearch.yml`
  119. | $ES_HOME/config
  120. | path.conf
  121. | data
  122. | The location of the data files of each index / shard allocated
  123. on the node. Can hold multiple locations.
  124. | $ES_HOME/data
  125. | path.data
  126. | logs
  127. | Log files location.
  128. | $ES_HOME/logs
  129. | path.logs
  130. | plugins
  131. | Plugin files location. Each plugin will be contained in a subdirectory.
  132. | $ES_HOME/plugins
  133. |
  134. | repo
  135. | 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.
  136. d| Not configured
  137. | path.repo
  138. | script
  139. | Location of script files.
  140. | $ES_HOME/scripts
  141. | path.scripts
  142. |=======================================================================
  143. include::next-steps.asciidoc[]