shards_allocation.asciidoc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. [[cluster-shard-allocation-settings]]
  2. ==== Cluster-level shard allocation settings
  3. You can use the following settings to control shard allocation and recovery:
  4. [[cluster-routing-allocation-enable]]
  5. `cluster.routing.allocation.enable`::
  6. +
  7. --
  8. (<<dynamic-cluster-setting,Dynamic>>)
  9. Enable or disable allocation for specific kinds of shards:
  10. * `all` - (default) Allows shard allocation for all kinds of shards.
  11. * `primaries` - Allows shard allocation only for primary shards.
  12. * `new_primaries` - Allows shard allocation only for primary shards for new indices.
  13. * `none` - No shard allocations of any kind are allowed for any indices.
  14. This setting does not affect the recovery of local primary shards when
  15. restarting a node. A restarted node that has a copy of an unassigned primary
  16. shard will recover that primary immediately, assuming that its allocation id matches
  17. one of the active allocation ids in the cluster state.
  18. --
  19. `cluster.routing.allocation.node_concurrent_incoming_recoveries`::
  20. (<<dynamic-cluster-setting,Dynamic>>)
  21. How many concurrent incoming shard recoveries are allowed to happen on a node. Incoming recoveries are the recoveries
  22. where the target shard (most likely the replica unless a shard is relocating) is allocated on the node. Defaults to `2`.
  23. `cluster.routing.allocation.node_concurrent_outgoing_recoveries`::
  24. (<<dynamic-cluster-setting,Dynamic>>)
  25. How many concurrent outgoing shard recoveries are allowed to happen on a node. Outgoing recoveries are the recoveries
  26. where the source shard (most likely the primary unless a shard is relocating) is allocated on the node. Defaults to `2`.
  27. `cluster.routing.allocation.node_concurrent_recoveries`::
  28. (<<dynamic-cluster-setting,Dynamic>>)
  29. A shortcut to set both `cluster.routing.allocation.node_concurrent_incoming_recoveries` and
  30. `cluster.routing.allocation.node_concurrent_outgoing_recoveries`.
  31. `cluster.routing.allocation.node_initial_primaries_recoveries`::
  32. (<<dynamic-cluster-setting,Dynamic>>)
  33. While the recovery of replicas happens over the network, the recovery of
  34. an unassigned primary after node restart uses data from the local disk.
  35. These should be fast so more initial primary recoveries can happen in
  36. parallel on the same node. Defaults to `4`.
  37. [[cluster-routing-allocation-same-shard-host]]
  38. `cluster.routing.allocation.same_shard.host`::
  39. (<<dynamic-cluster-setting,Dynamic>>)
  40. Allows to perform a check to prevent allocation of multiple instances of
  41. the same shard on a single host, based on host name and host address.
  42. Defaults to `false`, meaning that no check is performed by default. This
  43. setting only applies if multiple nodes are started on the same machine.
  44. [[shards-rebalancing-settings]]
  45. ==== Shard rebalancing settings
  46. A cluster is _balanced_ when it has an equal number of shards on each node
  47. without having a concentration of shards from any index on any node. {es} runs
  48. an automatic process called _rebalancing_ which moves shards between the nodes
  49. in your cluster to improve its balance. Rebalancing obeys all other shard
  50. allocation rules such as <<cluster-shard-allocation-filtering,allocation
  51. filtering>> and <<forced-awareness,forced awareness>> which may prevent it from
  52. completely balancing the cluster. In that case, rebalancing strives to achieve
  53. the most balanced cluster possible within the rules you have configured. If you
  54. are using <<data-tiers,data tiers>> then {es} automatically applies allocation
  55. filtering rules to place each shard within the appropriate tier. These rules
  56. mean that the balancer works independently within each tier.
  57. You can use the following settings to control the rebalancing of shards across
  58. the cluster:
  59. `cluster.routing.rebalance.enable`::
  60. +
  61. --
  62. (<<dynamic-cluster-setting,Dynamic>>)
  63. Enable or disable rebalancing for specific kinds of shards:
  64. * `all` - (default) Allows shard balancing for all kinds of shards.
  65. * `primaries` - Allows shard balancing only for primary shards.
  66. * `replicas` - Allows shard balancing only for replica shards.
  67. * `none` - No shard balancing of any kind are allowed for any indices.
  68. --
  69. `cluster.routing.allocation.allow_rebalance`::
  70. +
  71. --
  72. (<<dynamic-cluster-setting,Dynamic>>)
  73. Specify when shard rebalancing is allowed:
  74. * `always` - Always allow rebalancing.
  75. * `indices_primaries_active` - Only when all primaries in the cluster are allocated.
  76. * `indices_all_active` - (default) Only when all shards (primaries and replicas) in the cluster are allocated.
  77. --
  78. `cluster.routing.allocation.cluster_concurrent_rebalance`::
  79. (<<dynamic-cluster-setting,Dynamic>>)
  80. Allow to control how many concurrent shard rebalances are
  81. allowed cluster wide. Defaults to `2`. Note that this setting
  82. only controls the number of concurrent shard relocations due
  83. to imbalances in the cluster. This setting does not limit shard
  84. relocations due to <<cluster-shard-allocation-filtering,allocation
  85. filtering>> or <<forced-awareness,forced awareness>>.
  86. [[shards-rebalancing-heuristics]]
  87. ==== Shard balancing heuristics settings
  88. Rebalancing works by computing a _weight_ for each node based on its allocation
  89. of shards, and then moving shards between nodes to reduce the weight of the
  90. heavier nodes and increase the weight of the lighter ones. The cluster is
  91. balanced when there is no possible shard movement that can bring the weight of
  92. any node closer to the weight of any other node by more than a configurable
  93. threshold. The following settings allow you to control the details of these
  94. calculations.
  95. `cluster.routing.allocation.balance.shard`::
  96. (<<dynamic-cluster-setting,Dynamic>>)
  97. Defines the weight factor for the total number of shards allocated on a node
  98. (float). Defaults to `0.45f`. Raising this raises the tendency to
  99. equalize the number of shards across all nodes in the cluster.
  100. `cluster.routing.allocation.balance.index`::
  101. (<<dynamic-cluster-setting,Dynamic>>)
  102. Defines the weight factor for the number of shards per index allocated
  103. on a specific node (float). Defaults to `0.55f`. Raising this raises the
  104. tendency to equalize the number of shards per index across all nodes in
  105. the cluster.
  106. `cluster.routing.allocation.balance.threshold`::
  107. (<<dynamic-cluster-setting,Dynamic>>)
  108. Minimal optimization value of operations that should be performed (non
  109. negative float). Defaults to `1.0f`. Raising this will cause the cluster
  110. to be less aggressive about optimizing the shard balance.
  111. NOTE: Regardless of the result of the balancing algorithm, rebalancing might
  112. not be allowed due to forced awareness or allocation filtering.