Files
elasticsearch/docs/配置/01.配置简介.md
2023-04-17 08:00:55 +00:00

47 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 概述
Elasticsearch 有很好的默认配置所以仅需要很小的配置。并且很多设置都可以通过集群API来控制。
配置文件中有很多**节点专用**配置,比如 (`node.name` 和路径),或节点为了能够加入群集而需要的设置,比如`cluster.name``network.host`
Elasticsearch 有三个配置文件:
- elasticsearch.yml 用于配置 Elasticsearch
- jvm.options 用于配置 Elasticsearch JVM 的设置
- log4j2.properties 用户配置 Elasticsearch 日志
配置文件存放在 config 目录下默认的存放位置取决于安装是从归档发行版tar.gz 或 zip还是软件包发行版Debian 或 RPM 软件包)。
配置文件格式
```yaml
path:
data: /var/lib/elasticsearch
logs: /var/log/elasticsearch
```
```yaml
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
```
```yaml
discovery.seed_hosts:
- 192.168.1.10:9300
- 192.168.1.11
- seeds.mydomain.com
```
环境变量
```
node.name: ${HOSTNAME}
network.host: ${ES_NETWORK_HOST}
```