zip-targz.asciidoc 5.8 KB

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