Disable re-balancing ElasticSeach if one of the nodes is disabled

Imagine a case where I have

  • 3 (AWS) Nodes
  • Index (allows you to call him friends) with 3 fragments and 1 replica.

S1 (primary fragment of friends of pointer 1)

S2 (primary fragment of friends of pointers 2)

S3 (primary fragment of friends of pointer 3)

R1 (copy of shard 1)

R2 (Replica of Shard 2) R3 (copy of Shard 3)

Suppose that Node1 has (S1 R2) and is the main

Node2 has (S2 R3)
Node3 has (S3 R1)

Now, if due to a connection failure, Node 2 is omitted.

Load balancing will happen and Node 1 will promote the replica (R2) as primary, and a new replica for (R2) will be created in Node3

Finally, after load balancing it will be like

Node1 has (S1 S2, R3)
Node3 has (S3 R1, R2)

During this rebalancing, heavy I / O operations occur, and the elasticity search state turns red → yellow and then green.

My requirement is that if Node 2 is down, the nodes do not have to rebalance. I’m OK, if the results on request show the results of only fragments S1 and S3. And when Node 2 is gone again, rebalancing should not happen.

+5
source share
1 answer

You can accomplish this by disabling shard highlighting.

curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "none"}}' 

If you want to enable selection again:

 curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "all"}}' 
+2
source

Source: https://habr.com/ru/post/1216063/


All Articles