elasticSearch配置
warning:
这篇文章距离上次修改已过180天,其中的内容可能已经有所变动。
Elasticsearch 配置通常在 elasticsearch.yml
文件中设置。以下是一些常见配置设置的例子:
- 设置节点名称:
node.name: node1
- 设置数据和日志路径:
path.data: /path/to/data
path.logs: /path/to/logs
- 设置网络相关配置(例如,设置绑定的IP地址和端口):
network.host: 192.168.1.1
http.port: 9200
- 设置集群名称:
cluster.name: my-cluster
- 设置节点是否有资格被选为主节点:
node.master: true
- 设置节点是否存储数据:
node.data: true
- 设置初始主节点列表(用于启动新集群时选举主节点):
discovery.seed_hosts: ["host1", "host2"]
- 设置内存分配:
bootstrap.memory_lock: true
- 设置索引分片数量:
index.number_of_shards: 3
- 设置索引副本分片数量:
index.number_of_replicas: 2
这些配置项可以根据您的需求进行调整。在修改配置后,您可能需要重启 Elasticsearch 服务以使更改生效。
评论已关闭