elastic学习-单双三节点
1. 单节点模式
To ensure your cluster can report a green status, override the default by setting index.number_of_replicas
to 0 on every index.
2.两个节点的集群
两个节点都作为数据节点;
recommend they
both
bedata
nodesindex.number_of_replicas: 1
每个索引都设置备份数为1;setting
index.number_of_replicas
to1
on every index其中一个节点设置
node.master: false
,确保一个节点不是master备选节点;set
node.master: false
on one of your two nodes so that it is not master-eligible(默认每个节点都有全部的role) 双节点时,设置其中一个不要作为备选master的节点!(
node.master: false
)By default, each node is assigned every role. We recommend you assign both nodes all other roles except master eligibility. If one node fails, the other node can handle its tasks.
不推荐双节点-弹性力不足
Because it’s not resilient to failures, we do not recommend deploying a two-node cluster in production.
3. 3个节点集群
设置一个仅投票节点:
node.roles: [ data, master, voting_only ]
(必须是master,但是不会成为master,历史原因)Only nodes with the master role can be marked as having the voting_only role.