2020-06-01 13:15:08 -04:00
|
|
|
[[cluster-shard-allocation-settings]]
|
|
|
|
==== Cluster-level shard allocation settings
|
2015-06-22 23:49:45 +02:00
|
|
|
|
2020-08-31 11:19:57 -04:00
|
|
|
You can use the following settings to control shard allocation and recovery:
|
2015-06-22 23:49:45 +02:00
|
|
|
|
2020-06-01 13:15:08 -04:00
|
|
|
[[cluster-routing-allocation-enable]]
|
2015-06-22 23:49:45 +02:00
|
|
|
`cluster.routing.allocation.enable`::
|
|
|
|
+
|
|
|
|
--
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
Enable or disable allocation for specific kinds of shards:
|
|
|
|
|
|
|
|
* `all` - (default) Allows shard allocation for all kinds of shards.
|
|
|
|
* `primaries` - Allows shard allocation only for primary shards.
|
|
|
|
* `new_primaries` - Allows shard allocation only for primary shards for new indices.
|
|
|
|
* `none` - No shard allocations of any kind are allowed for any indices.
|
|
|
|
|
|
|
|
This setting does not affect the recovery of local primary shards when
|
|
|
|
restarting a node. A restarted node that has a copy of an unassigned primary
|
2015-12-07 15:09:45 +01:00
|
|
|
shard will recover that primary immediately, assuming that its allocation id matches
|
|
|
|
one of the active allocation ids in the cluster state.
|
2015-06-22 23:49:45 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
|
2015-12-09 14:14:18 +01:00
|
|
|
`cluster.routing.allocation.node_concurrent_incoming_recoveries`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-12-09 14:14:18 +01:00
|
|
|
How many concurrent incoming shard recoveries are allowed to happen on a node. Incoming recoveries are the recoveries
|
|
|
|
where the target shard (most likely the replica unless a shard is relocating) is allocated on the node. Defaults to `2`.
|
|
|
|
|
|
|
|
`cluster.routing.allocation.node_concurrent_outgoing_recoveries`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-12-09 14:14:18 +01:00
|
|
|
How many concurrent outgoing shard recoveries are allowed to happen on a node. Outgoing recoveries are the recoveries
|
|
|
|
where the source shard (most likely the primary unless a shard is relocating) is allocated on the node. Defaults to `2`.
|
2015-06-22 23:49:45 +02:00
|
|
|
|
2017-02-14 14:14:41 +02:00
|
|
|
`cluster.routing.allocation.node_concurrent_recoveries`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2017-02-14 14:14:41 +02:00
|
|
|
A shortcut to set both `cluster.routing.allocation.node_concurrent_incoming_recoveries` and
|
|
|
|
`cluster.routing.allocation.node_concurrent_outgoing_recoveries`.
|
|
|
|
|
|
|
|
|
2015-06-22 23:49:45 +02:00
|
|
|
`cluster.routing.allocation.node_initial_primaries_recoveries`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
While the recovery of replicas happens over the network, the recovery of
|
|
|
|
an unassigned primary after node restart uses data from the local disk.
|
|
|
|
These should be fast so more initial primary recoveries can happen in
|
|
|
|
parallel on the same node. Defaults to `4`.
|
|
|
|
|
|
|
|
|
|
|
|
`cluster.routing.allocation.same_shard.host`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
Allows to perform a check to prevent allocation of multiple instances of
|
|
|
|
the same shard on a single host, based on host name and host address.
|
|
|
|
Defaults to `false`, meaning that no check is performed by default. This
|
|
|
|
setting only applies if multiple nodes are started on the same machine.
|
|
|
|
|
2020-06-01 13:15:08 -04:00
|
|
|
[[shards-rebalancing-settings]]
|
|
|
|
==== Shard rebalancing settings
|
2015-06-22 23:49:45 +02:00
|
|
|
|
2020-12-07 14:51:26 +00:00
|
|
|
A cluster is _balanced_ when it has an equal number of shards on each node
|
|
|
|
without having a concentration of shards from any index on any node. {es} runs
|
|
|
|
an automatic process called _rebalancing_ which moves shards between the nodes
|
|
|
|
in your cluster to improve its balance. Rebalancing obeys all other shard
|
|
|
|
allocation rules such as <<cluster-shard-allocation-filtering,allocation
|
|
|
|
filtering>> and <<forced-awareness,forced awareness>> which may prevent it from
|
|
|
|
completely balancing the cluster. In that case, rebalancing strives to acheve
|
|
|
|
the most balanced cluster possible within the rules you have configured. If you
|
|
|
|
are using <<data-tiers,data tiers>> then {es} automatically applies allocation
|
|
|
|
filtering rules to place each shard within the appropriate tier. These rules
|
|
|
|
mean that the balancer works independently within each tier.
|
|
|
|
|
2020-08-31 11:19:57 -04:00
|
|
|
You can use the following settings to control the rebalancing of shards across
|
|
|
|
the cluster:
|
2015-06-22 23:49:45 +02:00
|
|
|
|
|
|
|
`cluster.routing.rebalance.enable`::
|
|
|
|
+
|
|
|
|
--
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
Enable or disable rebalancing for specific kinds of shards:
|
|
|
|
|
|
|
|
* `all` - (default) Allows shard balancing for all kinds of shards.
|
|
|
|
* `primaries` - Allows shard balancing only for primary shards.
|
|
|
|
* `replicas` - Allows shard balancing only for replica shards.
|
|
|
|
* `none` - No shard balancing of any kind are allowed for any indices.
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
`cluster.routing.allocation.allow_rebalance`::
|
|
|
|
+
|
|
|
|
--
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
Specify when shard rebalancing is allowed:
|
|
|
|
|
|
|
|
|
2016-02-13 15:15:52 +01:00
|
|
|
* `always` - Always allow rebalancing.
|
2015-06-22 23:49:45 +02:00
|
|
|
* `indices_primaries_active` - Only when all primaries in the cluster are allocated.
|
2016-02-13 15:15:52 +01:00
|
|
|
* `indices_all_active` - (default) Only when all shards (primaries and replicas) in the cluster are allocated.
|
2015-06-22 23:49:45 +02:00
|
|
|
--
|
|
|
|
|
|
|
|
`cluster.routing.allocation.cluster_concurrent_rebalance`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
Allow to control how many concurrent shard rebalances are
|
2016-09-16 16:06:18 -04:00
|
|
|
allowed cluster wide. Defaults to `2`. Note that this setting
|
|
|
|
only controls the number of concurrent shard relocations due
|
|
|
|
to imbalances in the cluster. This setting does not limit shard
|
2020-06-01 13:15:08 -04:00
|
|
|
relocations due to <<cluster-shard-allocation-filtering,allocation
|
|
|
|
filtering>> or <<forced-awareness,forced awareness>>.
|
2015-06-22 23:49:45 +02:00
|
|
|
|
2020-06-01 13:15:08 -04:00
|
|
|
[[shards-rebalancing-heuristics]]
|
|
|
|
==== Shard balancing heuristics settings
|
2015-06-22 23:49:45 +02:00
|
|
|
|
2020-12-07 14:51:26 +00:00
|
|
|
Rebalancing works by computing a _weight_ for each node based on its allocation
|
|
|
|
of shards, and then moving shards between nodes to reduce the weight of the
|
|
|
|
heavier nodes and increase the weight of the lighter ones. The cluster is
|
|
|
|
balanced when there is no possible shard movement that can bring the weight of
|
|
|
|
any node closer to the weight of any other node by more than a configurable
|
|
|
|
threshold. The following settings allow you to control the details of these
|
|
|
|
calculations.
|
2015-06-22 23:49:45 +02:00
|
|
|
|
|
|
|
`cluster.routing.allocation.balance.shard`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2017-08-03 05:24:26 -04:00
|
|
|
Defines the weight factor for the total number of shards allocated on a node
|
2015-06-22 23:49:45 +02:00
|
|
|
(float). Defaults to `0.45f`. Raising this raises the tendency to
|
|
|
|
equalize the number of shards across all nodes in the cluster.
|
|
|
|
|
|
|
|
`cluster.routing.allocation.balance.index`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2017-08-03 05:24:26 -04:00
|
|
|
Defines the weight factor for the number of shards per index allocated
|
2015-06-22 23:49:45 +02:00
|
|
|
on a specific node (float). Defaults to `0.55f`. Raising this raises the
|
|
|
|
tendency to equalize the number of shards per index across all nodes in
|
|
|
|
the cluster.
|
|
|
|
|
|
|
|
`cluster.routing.allocation.balance.threshold`::
|
2020-08-31 11:19:57 -04:00
|
|
|
(<<dynamic-cluster-setting,Dynamic>>)
|
2015-06-22 23:49:45 +02:00
|
|
|
Minimal optimization value of operations that should be performed (non
|
|
|
|
negative float). Defaults to `1.0f`. Raising this will cause the cluster
|
|
|
|
to be less aggressive about optimizing the shard balance.
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: Regardless of the result of the balancing algorithm, rebalancing might
|
|
|
|
not be allowed due to forced awareness or allocation filtering.
|