WARNING: Version 5.6 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Install Elasticsearch with .zip or .tar.gz
editInstall Elasticsearch with .zip
or .tar.gz
editElasticsearch is provided as a .zip
and as a .tar.gz
package. These
packages can be used to install Elasticsearch on any system and are the
easiest package format to use when trying out Elasticsearch.
The latest stable version of Elasticsearch can be found on the Download Elasticsearch page. Other versions can be found on the Past Releases page.
Elasticsearch requires Java 8. Use the official Oracle distribution or an open-source distribution such as OpenJDK.
Download and install the .zip
package
editThe .zip
archive for Elasticsearch v5.6.16 can be downloaded and installed as follows:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.zip sha1sum elasticsearch-5.6.16.zip unzip elasticsearch-5.6.16.zip cd elasticsearch-5.6.16/
Compare the SHA produced by |
|
This directory is known as |
Download and install the .tar.gz
package
editThe .tar.gz
archive for Elasticsearch v5.6.16 can be downloaded and installed as follows:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz sha1sum elasticsearch-5.6.16.tar.gz tar -xzf elasticsearch-5.6.16.tar.gz cd elasticsearch-5.6.16/
Compare the SHA produced by |
|
This directory is known as |
Running Elasticsearch from the command line
editElasticsearch can be started from the command line as follows:
./bin/elasticsearch
By default, Elasticsearch runs in the foreground, prints its logs to the
standard output (stdout
), and can be stopped by pressing Ctrl-C
.
All scripts packaged with Elasticsearch require a version of Bash
that supports arrays and assume that Bash is available at /bin/bash
.
As such, Bash should be available at this path either directly or via a
symbolic link.
Checking that Elasticsearch is running
editYou can test that your Elasticsearch node is running by sending an HTTP
request to port 9200
on localhost
:
GET /
which should give you a response something like this:
{ "name" : "Cp8oag6", "cluster_name" : "elasticsearch", "cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA", "version" : { "number" : "5.6.16", "build_hash" : "f27399d", "build_date" : "2016-03-30T09:51:41.449Z", "build_snapshot" : false, "lucene_version" : "6.6.1" }, "tagline" : "You Know, for Search" }
Log printing to stdout
can be disabled using the -q
or --quiet
option on the command line.
Running as a daemon
editTo run Elasticsearch as a daemon, specify -d
on the command line, and record
the process ID in a file using the -p
option:
./bin/elasticsearch -d -p pid
Log messages can be found in the $ES_HOME/logs/
directory.
To shut down Elasticsearch, kill the process ID recorded in the pid
file:
kill `cat pid`
Configuring Elasticsearch on the command line
editElasticsearch loads its configuration from the $ES_HOME/config/elasticsearch.yml
file by default. The format of this config file is explained in
Configuring Elasticsearch.
Any settings that can be specified in the config file can also be specified on
the command line, using the -E
syntax as follows:
./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
Typically, any cluster-wide settings (like cluster.name
) should be
added to the elasticsearch.yml
config file, while any node-specific settings
such as node.name
could be specified on the command line.
Directory layout of .zip
and .tar.gz
archives
editThe .zip
and .tar.gz
packages are entirely self-contained. All files and
directories are, by default, contained within $ES_HOME
— the directory
created when unpacking the archive.
This is very convenient because you don’t have to create any directories to
start using Elasticsearch, and uninstalling Elasticsearch is as easy as
removing the $ES_HOME
directory. However, it is advisable to change the
default locations of the config directory, the data directory, and the logs
directory so that you do not delete important data later on.
Type | Description | Default Location | Setting |
---|---|---|---|
home |
Elasticsearch home directory or |
Directory created by unpacking the archive |
|
bin |
Binary scripts including |
|
|
conf |
Configuration files including |
|
|
data |
The location of the data files of each index / shard allocated on the node. Can hold multiple locations. |
|
|
logs |
Log files location. |
|
|
plugins |
Plugin files location. Each plugin will be contained in a subdirectory. |
|
|
repo |
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. |
Not configured |
|
script |
Location of script files. |
|
|
Next steps
editYou now have a test Elasticsearch environment set up. Before you start serious development or go into production with Elasticsearch, you will need to do some additional setup:
- Learn how to configure Elasticsearch.
- Configure important Elasticsearch settings.
- Configure important system settings.