shards_allocation.asciidoc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. [[shards-allocation]]
  2. === Cluster Level Shard Allocation
  3. Shard allocation is the process of allocating shards to nodes. This can
  4. happen during initial recovery, replica allocation, rebalancing, or
  5. when nodes are added or removed.
  6. [float]
  7. === Shard Allocation Settings
  8. The following _dynamic_ settings may be used to control shard allocation and recovery:
  9. `cluster.routing.allocation.enable`::
  10. +
  11. --
  12. Enable or disable allocation for specific kinds of shards:
  13. * `all` - (default) Allows shard allocation for all kinds of shards.
  14. * `primaries` - Allows shard allocation only for primary shards.
  15. * `new_primaries` - Allows shard allocation only for primary shards for new indices.
  16. * `none` - No shard allocations of any kind are allowed for any indices.
  17. This setting does not affect the recovery of local primary shards when
  18. restarting a node. A restarted node that has a copy of an unassigned primary
  19. shard will recover that primary immediately, assuming that its allocation id matches
  20. one of the active allocation ids in the cluster state.
  21. --
  22. `cluster.routing.allocation.node_concurrent_incoming_recoveries`::
  23. How many concurrent incoming shard recoveries are allowed to happen on a node. Incoming recoveries are the recoveries
  24. where the target shard (most likely the replica unless a shard is relocating) is allocated on the node. Defaults to `2`.
  25. `cluster.routing.allocation.node_concurrent_outgoing_recoveries`::
  26. How many concurrent outgoing shard recoveries are allowed to happen on a node. Outgoing recoveries are the recoveries
  27. where the source shard (most likely the primary unless a shard is relocating) is allocated on the node. Defaults to `2`.
  28. `cluster.routing.allocation.node_initial_primaries_recoveries`::
  29. While the recovery of replicas happens over the network, the recovery of
  30. an unassigned primary after node restart uses data from the local disk.
  31. These should be fast so more initial primary recoveries can happen in
  32. parallel on the same node. Defaults to `4`.
  33. `cluster.routing.allocation.same_shard.host`::
  34. Allows to perform a check to prevent allocation of multiple instances of
  35. the same shard on a single host, based on host name and host address.
  36. Defaults to `false`, meaning that no check is performed by default. This
  37. setting only applies if multiple nodes are started on the same machine.
  38. [float]
  39. === Shard Rebalancing Settings
  40. The following _dynamic_ settings may be used to control the rebalancing of
  41. shards across the cluster:
  42. `cluster.routing.rebalance.enable`::
  43. +
  44. --
  45. Enable or disable rebalancing for specific kinds of shards:
  46. * `all` - (default) Allows shard balancing for all kinds of shards.
  47. * `primaries` - Allows shard balancing only for primary shards.
  48. * `replicas` - Allows shard balancing only for replica shards.
  49. * `none` - No shard balancing of any kind are allowed for any indices.
  50. --
  51. `cluster.routing.allocation.allow_rebalance`::
  52. +
  53. --
  54. Specify when shard rebalancing is allowed:
  55. * `always` - Always allow rebalancing.
  56. * `indices_primaries_active` - Only when all primaries in the cluster are allocated.
  57. * `indices_all_active` - (default) Only when all shards (primaries and replicas) in the cluster are allocated.
  58. --
  59. `cluster.routing.allocation.cluster_concurrent_rebalance`::
  60. Allow to control how many concurrent shard rebalances are
  61. allowed cluster wide. Defaults to `2`.
  62. [float]
  63. === Shard Balancing Heuristics
  64. The following settings are used together to determine where to place each
  65. shard. The cluster is balanced when no allowed action can bring the weights
  66. of each node closer together by more then the `balance.threshold`.
  67. `cluster.routing.allocation.balance.shard`::
  68. Defines the weight factor for shards allocated on a node
  69. (float). Defaults to `0.45f`. Raising this raises the tendency to
  70. equalize the number of shards across all nodes in the cluster.
  71. `cluster.routing.allocation.balance.index`::
  72. Defines a factor to the number of shards per index allocated
  73. on a specific node (float). Defaults to `0.55f`. Raising this raises the
  74. tendency to equalize the number of shards per index across all nodes in
  75. the cluster.
  76. `cluster.routing.allocation.balance.threshold`::
  77. Minimal optimization value of operations that should be performed (non
  78. negative float). Defaults to `1.0f`. Raising this will cause the cluster
  79. to be less aggressive about optimizing the shard balance.
  80. NOTE: Regardless of the result of the balancing algorithm, rebalancing might
  81. not be allowed due to forced awareness or allocation filtering.