zip-targz.asciidoc 5.9 KB

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