- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 420字
- 2021-06-24 14:51:49
How it works…
The Elasticsearch package generally contains the following directories:
- bin: This contains the scripts to start and manage Elasticsearch.
- elasticsearch.bat: This is the main executable script to start Elasticsearch.
- elasticsearch-plugin.bat: This is a script to manage plugins.
- config: This contains the Elasticsearch configs. The most important ones are as follows:
- elasticsearch.yml: This is the main config file for Elasticsearch
- log4j2.properties: This is the logging config file
- lib: This contains all the libraries required to run Elasticsearch.
- logs: This directory is empty at installation time, but in the future, it will contain the application logs.
- modules: This contains the Elasticsearch default plugin modules.
- plugins: This directory is empty at installation time, but it's the place where custom plugins will be installed.
During Elasticsearch startup, the following events happen:
- A node name is generated automatically (that is, fyBySLM) if it is not provided in elasticsearch.yml. The name is randomly generated, so it's a good idea to set it to a meaningful and memorable name instead.
- A node name hash is generated for this node, for example, fyBySLMcR3uqKiYC32P5Sg.
- The default installed modules are loaded. The most important ones are as follows:
- aggs-matrix-stats: This provides support for aggregation matrix stats.
- analysis-common: This is a common analyzer for Elasticsearch, which extends the language processing capabilities of Elasticsearch.
- ingest-common: These include common functionalities for the ingest module.
- lang-expression/lang-mustache/lang-painless: These are the default supported scripting languages of Elasticsearch.
- mapper-extras: This provides an extra mapper type to be used, such as token_count and scaled_float.
- parent-join: This provides an extra query, such as has_children and has_parent.
- percolator: This provides percolator capabilities.
- rank-eval: This provides support for the experimental rank evaluation APIs. These are used to evaluate hit scoring based on queries.
- reindex: This provides support for reindex actions (reindex/update by query).
- x-pack-*: All the xpack modules depend on a subscription for their activation.
- If there are plugins, they are loaded.
- If not configured, Elasticsearch binds the following two ports on the localhost 127.0.0.1 automatically:
- 9300: This port is used for internal intranode communication.
- 9200: This port is used for the HTTP REST API.
- After starting, if indices are available, they are restored and ready to be used.
If these port numbers are already bound, Elasticsearch automatically increments the port number and tries to bind on them until a port is available (that is, 9201, 9202, and so on).
There are more events that are fired during Elasticsearch startup. We'll see them in detail in other recipes.