Elasticsearch 7.0 Cookbook(Fourth Edition)
上QQ阅读APP看书,第一时间看更新

How it works…

The Docker container provides a Debian Linux installation with Elasticsearch installed.

Elasticsearch Docker installation is easily repeatable and does not require a lot of editing and configuration.

The default installation can be tuned into in several ways, for example:

  1. You can pass a parameter to Elasticsearch via the command line using the -e flag, as follows:
docker run -d docker.elastic.co/elasticsearch/elasticsearch:7.0.0 elasticsearch -e "node.name=NodeName"
  1. You can customize the default settings of the environment that's providing custom Elasticsearch configuration by providing a volume mount point at /usr/share/elasticsearch/configas follows:
docker run -d -v "$PWD/config":/usr/share/elasticsearch/config docker.elastic.co/elasticsearch/elasticsearch:7.0.0
  1. You can persist the data between Docker reboots configuring a local data mount point to store index data. The path to be used as a mount point is /usr/share/elasticsearch/configas follows:
docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data docker.elastic.co/elasticsearch/elasticsearch:7.0.0