shards_allocation.asciidoc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. (<<dynamic-cluster-setting,Dynamic>>)
  39. Allows to perform a check to prevent allocation of multiple instances of
  40. the same shard on a single host, based on host name and host address.
  41. Defaults to `false`, meaning that no check is performed by default. This
  42. setting only applies if multiple nodes are started on the same machine.
  43. [[shards-rebalancing-settings]]
  44. ==== Shard rebalancing settings
  45. You can use the following settings to control the rebalancing of shards across
  46. the cluster:
  47. `cluster.routing.rebalance.enable`::
  48. +
  49. --
  50. (<<dynamic-cluster-setting,Dynamic>>)
  51. Enable or disable rebalancing for specific kinds of shards:
  52. * `all` - (default) Allows shard balancing for all kinds of shards.
  53. * `primaries` - Allows shard balancing only for primary shards.
  54. * `replicas` - Allows shard balancing only for replica shards.
  55. * `none` - No shard balancing of any kind are allowed for any indices.
  56. --
  57. `cluster.routing.allocation.allow_rebalance`::
  58. +
  59. --
  60. (<<dynamic-cluster-setting,Dynamic>>)
  61. Specify when shard rebalancing is allowed:
  62. * `always` - Always allow rebalancing.
  63. * `indices_primaries_active` - Only when all primaries in the cluster are allocated.
  64. * `indices_all_active` - (default) Only when all shards (primaries and replicas) in the cluster are allocated.
  65. --
  66. `cluster.routing.allocation.cluster_concurrent_rebalance`::
  67. (<<dynamic-cluster-setting,Dynamic>>)
  68. Allow to control how many concurrent shard rebalances are
  69. allowed cluster wide. Defaults to `2`. Note that this setting
  70. only controls the number of concurrent shard relocations due
  71. to imbalances in the cluster. This setting does not limit shard
  72. relocations due to <<cluster-shard-allocation-filtering,allocation
  73. filtering>> or <<forced-awareness,forced awareness>>.
  74. [[shards-rebalancing-heuristics]]
  75. ==== Shard balancing heuristics settings
  76. The following settings are used together to determine where to place each
  77. shard. The cluster is balanced when no allowed rebalancing operation can bring the weight
  78. of any node closer to the weight of any other node by more than the `balance.threshold`.
  79. `cluster.routing.allocation.balance.shard`::
  80. (<<dynamic-cluster-setting,Dynamic>>)
  81. Defines the weight factor for the total number of shards allocated on a node
  82. (float). Defaults to `0.45f`. Raising this raises the tendency to
  83. equalize the number of shards across all nodes in the cluster.
  84. `cluster.routing.allocation.balance.index`::
  85. (<<dynamic-cluster-setting,Dynamic>>)
  86. Defines the weight factor for the number of shards per index allocated
  87. on a specific node (float). Defaults to `0.55f`. Raising this raises the
  88. tendency to equalize the number of shards per index across all nodes in
  89. the cluster.
  90. `cluster.routing.allocation.balance.threshold`::
  91. (<<dynamic-cluster-setting,Dynamic>>)
  92. Minimal optimization value of operations that should be performed (non
  93. negative float). Defaults to `1.0f`. Raising this will cause the cluster
  94. to be less aggressive about optimizing the shard balance.
  95. NOTE: Regardless of the result of the balancing algorithm, rebalancing might
  96. not be allowed due to forced awareness or allocation filtering.