Cyr*_*ian 7 sharding elasticsearch
想象一下我的情况
S1(索引朋友主要分片1)
S2(索引朋友主要碎片2)
S3(索引朋友主要分片3)
R1(碎片1的复制品)
R2(碎片2的复制品)R3(碎片3的复制品)
假设Node1有(S1 R2)并且是主节点
Node2具有(S2 R3)
Node3具有(S3 R1)
现在,如果由于连接故障,节点2发生故障.
将发生负载平衡,节点1将升级副本(R2)作为主要,并且将在Node3中创建(R2)的新副本
最后在负载平衡之后就会如此
Node1具有(S1 S2,R3)
Node3具有(S3 R1,R2)
在此重新平衡期间,重型IO操作发生,弹性搜索运行状况将变为红色 - >黄色,然后是绿色.
我的要求是,如果节点2关闭,节点必须不再平衡.如果查询结果显示仅来自shard S1和S3的结果,我很好.当节点2再次返回时,不会发生重新平衡.
您可以通过禁用分片分配来完成此操作。
curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "none"}}'
Run Code Online (Sandbox Code Playgroud)
如果要重新打开分配:
curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "all"}}'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
454 次 |
| 最近记录: |