zip-targz.asciidoc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 as follows:
  69. [source,sh]
  70. --------------------------------------------
  71. ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
  72. --------------------------------------------
  73. TIP: Typically, any cluster-wide settings (like `cluster.name`) should be
  74. added to the `elasticsearch.yml` config file, while any node-specific settings
  75. such as `node.name` could be specified on the command line.
  76. [[zip-targz-layout]]
  77. ==== Directory layout of `.zip` and `.tar.gz` archives
  78. The `.zip` and `.tar.gz` packages are entirely self-contained. All files and
  79. directories are, by default, contained within `$ES_HOME` -- the directory
  80. created when unpacking the archive.
  81. This is very convenient because you don't have to create any directories to
  82. start using Elasticsearch, and uninstalling Elasticsearch is as easy as
  83. removing the `$ES_HOME` directory. However, it is advisable to change the
  84. default locations of the config directory, the data directory, and the logs
  85. directory so that you do not delete important data later on.
  86. [cols="<h,<,<m,<m",options="header",]
  87. |=======================================================================
  88. | Type | Description | Default Location | Setting
  89. | home
  90. | Elasticsearch home directory or `$ES_HOME`
  91. d| Directory created by unpacking the archive
  92. |
  93. | bin
  94. | Binary scripts including `elasticsearch` to start a node
  95. and `elasticsearch-plugin` to install plugins
  96. | $ES_HOME/bin
  97. d|
  98. | conf
  99. | Configuration files including `elasticsearch.yml`
  100. | $ES_HOME/config
  101. | path.conf
  102. | data
  103. | The location of the data files of each index / shard allocated
  104. on the node. Can hold multiple locations.
  105. | $ES_HOME/data
  106. | path.data
  107. | logs
  108. | Log files location.
  109. | $ES_HOME/logs
  110. | path.logs
  111. | plugins
  112. | Plugin files location. Each plugin will be contained in a subdirectory.
  113. | $ES_HOME/plugins
  114. | repo
  115. | 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.
  116. d| Not configured
  117. | path.repo
  118. | script
  119. | Location of script files.
  120. | $ES_HOME/scripts
  121. | path.scripts
  122. |=======================================================================
  123. include::next-steps.asciidoc[]