Class BalancedShardsAllocator

All Implemented Interfaces:

public class BalancedShardsAllocator
extends java.lang.Object
implements ShardsAllocator
The BalancedShardsAllocator re-balances the nodes allocations within an cluster based on a BalancedShardsAllocator.WeightFunction. The clusters balance is defined by four parameters which can be set in the cluster update API that allows changes in real-time:
  • cluster.routing.allocation.balance.shard - The shard balance defines the weight factor for shards allocated on a RoutingNode
  • cluster.routing.allocation.balance.index - The index balance defines a factor to the number of ShardRoutings per index allocated on a specific node
  • cluster.routing.allocation.balance.threshold - A threshold to set the minimal optimization value of operations that should be performed

These parameters are combined in a BalancedShardsAllocator.WeightFunction that allows calculation of node weights which are used to re-balance shards based on global as well as per-index factors.