配置详解
Cluster
集群名称,默认为elasticsearch:
cluster.name: elasticsearch
设置一个节点的并发数量,有两种情况,一种是在初始复苏过程中:
cluster.routing.allocation.node_initial_primaries_recoveries: 4
另一种是在添加、删除节点及调整时:
cluster.routing.allocation.node_concurrent_recoveries: 2
Node
- 节点名称,es启动时会自动创建节点名称,但你也可进行配置:
node.name: elasticsearch-01
是否允许作为主节点,默认值为true:
node.master: true
是否存储数据,即存储索引片段,默认值为true:
node.data: true
注意:
master和data同时配置会产生一些奇异的效果:
- 当master为false,而data为true时,会对该节点产生严重负荷;
- 当master为true,而data为false时,该节点作为一个协调者;
- 当master为false,data也为false时,该节点就变成了一个负载均衡器。