zip-targz.asciidoc 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. include::check-running.asciidoc[]
  59. Log printing to `stdout` can be disabled using the `-q` or `--quiet`
  60. option on the command line.
  61. [[setup-installation-daemon]]
  62. ==== Running as a daemon
  63. To run Elasticsearch as a daemon, specify `-d` on the command line, and record
  64. the process ID in a file using the `-p` option:
  65. [source,sh]
  66. --------------------------------------------
  67. ./bin/elasticsearch -d -p pid
  68. --------------------------------------------
  69. Log messages can be found in the `$ES_HOME/logs/` directory.
  70. To shut down Elasticsearch, kill the process ID recorded in the `pid` file:
  71. [source,sh]
  72. --------------------------------------------
  73. kill `cat pid`
  74. --------------------------------------------
  75. NOTE: The startup scripts provided in the <<rpm,RPM>> and <<deb,Debian>>
  76. packages take care of starting and stopping the Elasticsearch process for you.
  77. [[zip-targz-configuring]]
  78. ==== Configuring Elasticsearch on the command line
  79. Elasticsearch loads its configuration from the `$ES_HOME/config/elasticsearch.yml`
  80. file by default. The format of this config file is explained in
  81. <<settings>>.
  82. Any settings that can be specified in the config file can also be specified on
  83. the command line, using the `-E` syntax as follows:
  84. [source,sh]
  85. --------------------------------------------
  86. ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
  87. --------------------------------------------
  88. TIP: Typically, any cluster-wide settings (like `cluster.name`) should be
  89. added to the `elasticsearch.yml` config file, while any node-specific settings
  90. such as `node.name` could be specified on the command line.
  91. [[zip-targz-layout]]
  92. ==== Directory layout of `.zip` and `.tar.gz` archives
  93. The `.zip` and `.tar.gz` packages are entirely self-contained. All files and
  94. directories are, by default, contained within `$ES_HOME` -- the directory
  95. created when unpacking the archive.
  96. This is very convenient because you don't have to create any directories to
  97. start using Elasticsearch, and uninstalling Elasticsearch is as easy as
  98. removing the `$ES_HOME` directory. However, it is advisable to change the
  99. default locations of the config directory, the data directory, and the logs
  100. directory so that you do not delete important data later on.
  101. [cols="<h,<,<m,<m",options="header",]
  102. |=======================================================================
  103. | Type | Description | Default Location | Setting
  104. | home
  105. | Elasticsearch home directory or `$ES_HOME`
  106. d| Directory created by unpacking the archive
  107. |
  108. | bin
  109. | Binary scripts including `elasticsearch` to start a node
  110. and `elasticsearch-plugin` to install plugins
  111. | $ES_HOME/bin
  112. d|
  113. | conf
  114. | Configuration files including `elasticsearch.yml`
  115. | $ES_HOME/config
  116. | path.conf
  117. | data
  118. | The location of the data files of each index / shard allocated
  119. on the node. Can hold multiple locations.
  120. | $ES_HOME/data
  121. | path.data
  122. | logs
  123. | Log files location.
  124. | $ES_HOME/logs
  125. | path.logs
  126. | plugins
  127. | Plugin files location. Each plugin will be contained in a subdirectory.
  128. | $ES_HOME/plugins
  129. |
  130. | repo
  131. | 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.
  132. d| Not configured
  133. | path.repo
  134. | script
  135. | Location of script files.
  136. | $ES_HOME/scripts
  137. | path.scripts
  138. |=======================================================================
  139. include::next-steps.asciidoc[]