Updated on 2024-11-29 GMT+08:00

Distributing Shards Evenly

For more than five machine nodes, to evenly distribute shards on each instance, the following parameters are added to set the number of shards of each index on a single instance. As shown in the following figure, the number of shards of each index on each instance is 2.

curl -XPUT --tlsv1.2 --negotiate -k -u : "https://ip:httpport/myindex/_settings?pretty' -H 'Content-Type:application/json' -d '
{
    "index.routing.allocation.total_shards_per_node":"2"
}'