配置Elasticsearch
Elasticsearch具有三个配置文件:
* `elasticsearch.yml`用于配置Elasticsearch
* `jvm.options`用于配置Elasticsearch JVM设置
* `log4j2.properties`用于配置Elasticsearch日志记录
配置
* [路径设定](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/path-settings.html "path.data和path.logs")
```
path:
data: /var/lib/elasticsearch
logs: /var/log/elasticsearch
```
* [集群名称](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/cluster.name.html "cluster.name")
```
cluster.name: logging-prod
```
* [节点名称](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/node.name.html "节点名称")
```
node.name: prod-data-2
```
* [](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/network.host.html "网络主机")network.host
```
network.host: 192.168.1.1
```
* [Discovery setting](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/discovery-settings.html "Discovery settings")
当形成一个在其他服务器上具有节点的集群时,您必须提供集群中其他可能处于活动状态且可联系的其他节点的种子列表。可以指定如下:
```
discovery.zen.ping.unicast.hosts:
- 192.168.1.10:9300
- 192.168.1.11
- seeds.mydomain.com
discovery.zen.minimum_master_nodes: 2
```
* [堆大小](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/heap-size.html "设置堆大小")
* [堆转储路径](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/heap-dump-path.html "JVM堆转储路径")
* [GC记录](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/gc-logging.html "GC记录")
* [临时目录](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/es-tmpdir.html "临时目录")