Elasticsearch is provided as a.tar.gz package for Linux and MacOS.

This package is available for free under an Elastic license. It includes open source and free business features, as well as access to paid business features. Start A 30-day Trial can try all paid commercial features. For information on Elastic licensing levels, see the Subscriptions page.

The latest stable version of Elasticsearch can be found on the Download Elasticsearch page. Other versions can be found on the Past Releases Page.

NOTE: Elasticsearch includes an OpenJDK bundle from the JDK maintainer (GPLv2 + CE). To use your own Version of Java, see JVM Version Requirements.

Download and install the package for Linux

You can download and install the Linux package for Elasticsearch V7.9.3 as follows:

Wget wget HTTP: / / https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-linux-x86_64.tar.gz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-linux-x86_64.tar.gz.sha512 shasum - a 512 - c Elasticsearch-7.9.3-linux-x86_64.tar.gz. sha512 They should print ElasticSearch -{version}-linux-x86_64.tar.gz: OK. Tar -xzf elasticSearch-7.9.3-linux-x86_64.tar. gz CD elasticSearch-7.9.3 / #Copy the code

Or, you can download the following software packages, which contains only the Apache 2.0 license code: artifacts. Elastic. Co/downloads/e…

Download and install the package for MacOS

You can download and install the MacOS package for Elasticsearch V7.9.3 as follows:

Wget wget HTTP: / / https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-darwin-x86_64.tar.gz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-darwin-x86_64.tar.gz.sha512 shasum - a 512 - c Elasticsearch-7.9.3-darwin-x86_64.tar.gz. sha512 They should print ElasticSearch -{version} -Darwin -x86_64.tar.gz: OK. Tar -xzf elasticSearch-7.9.3 - Darwin x86_64.tar.gz CD ElasticSearch-7.9.3 / # $ES_HOMECopy the code

Or, you can download the following software packages, which contains only the Apache 2.0 license code: artifacts. Elastic. Co/downloads/e…

Enable automatic creation of system indexes

Some commercial features create indexes automatically in Elasticsearch. By default, Elasticsearch is configured to allow automatic index creation and no additional steps are required. However, if you have disabled automatic index creation in Elasticsearch, you must configure action.auto_create_index in elasticSearch.yml to allow commercial functions to create the following indexes:

action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
Copy the code

If you use Logstash or Beats, there is a good chance that you will need another index name in the action.auto_create_index setting, the exact value of which will depend on the local configuration. If you are unsure of the correct value for your environment, consider setting the value to *, which will allow all indexes to be created automatically.

Run Elasticsearch from the command line

You can start Elasticsearch from the command line as follows:

./bin/elasticsearch
Copy the code

If you have password protected the Elasticsearch keystore, you will be prompted to enter the password for the keystore. For more details, see Secure Settings.

By default, Elasticsearch runs in the foreground, prints its logs to standard output (STDout) and can be stopped by pressing Ctrl-C.

NOTE: All scripts packaged with Elasticsearch need Bash versions of Arrays support, assuming Bash is available at /bin/bash. Therefore, Bash should be available on this path either directly or via a symbolic link.

Check whether Elasticsearch is running

You can test whether the Elasticsearch node is running from the command line by sending an HTTP request to port 9200 on the localhost host:

curl -X GET "localhost:9200/? pretty"Copy the code

You should get something like this:

{ "name" : "Cp8oag6", "cluster_name" : "elasticsearch", "cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA", "version" : {" number ":" 7.9.3 ", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "f27399d", "build_date" : "2016-03-30T09:51:41.449z ", "build_snapshot" : false, "lucene_version" :" 2016-03-30T09:51:41.449z ", "build_snapshot" : false, "lucene_version" : "Minimum_index_compatibility_version" : "1.2.3", "minimum_index_compatibility_version" : "1.2.3"}, "tagline" : "You Know, for Search" }Copy the code

The ability to print logs to STdout can be disabled using the -q or –quiet option on the command line.

Run as a daemon

To run Elasticsearch as a daemon, specify -d on the command line and then use the -p option to record the process ID in a file:

./bin/elasticsearch -d -p pid
Copy the code

If you have password protected the Elasticsearch keystore, you will be prompted to enter the password for the keystore. For more details, see Secure Settings.

Log messages can be found in the $ES_HOME/logs/ directory.

To turn off Elasticsearch, kill the process ID recorded in the PID file:

pkill -F pid
Copy the code

NOTE: The startup scripts provided with RPM and Debian packages will start and stop the Elasticsearch process for you.

Configure Elasticsearch on the command line

By default, Elasticsearch from $ES_HOME/config/Elasticsearch yml file to load the configuration. The format of this configuration file is described in Configuring Elasticsearch.

You can use the -e syntax on the command line to specify any Settings in the configuration file as follows:

./bin/elasticsearch -d -Ecluster.name = my_cluster -Enode.name = node_1
Copy the code

TIP: In general, all cluster-scoped Settings (such as cluster.name) should be added to the ElasticSearch.yml configuration file, and any node-specific Settings (such as Node.name) can be specified on the command line.

Package directory layout

The package distribution is completely independent. By default, all files and directories are contained in $ES_HOME, which is the directory created when you unzip the package files.

This is handy because you don’t need to create any directories to start using Elasticsearch, and uninstalling Elasticsearch is as easy as deleting the $ES_HOME directory. However, it is recommended to change the default location of the configuration directory, data directory, and log directory so that important data is not deleted later.

Type Description Default Location Setting
home Elasticsearch home directory or $ES_HOME Directory created when the package is decompressed
bin Binary scripts, including ElasticSearch to start the node and ElasticSearch-plugin to install the plug-in $ES_HOME/bin
conf Configuration files, including elasticSearch.yml $ES_HOME/config ES_PATH_CONF
data The location of each index/sharded data file allocated on a node, which can hold multiple locations $ES_HOME/data path.data
logs Log file location $ES_HOME/logs path.logs
plugins Plug-in file location, each plug-in will be contained in a subdirectory $ES_HOME/plugins
repo Shared file system repository location that can hold multiple locations and can be placed in any subdirectory of any directory specified here Not configured path.repo

The next step

You have now set up a test Elasticsearch environment. Before you can begin serious development or go into production with Elasticsearch, you must make a few additional Settings:

  • How to configure Elasticsearch
  • Configure the important Elasticsearch Settings
  • Configure the important System Settings

See the website: www.elastic.co/guide/en/el…

Translation is not easy, please do not embezzle, if used, please indicate the source.