shards_allocation.asciidoc 5.1 KB

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