You're viewing version 2.16 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.
Cluster settings
The following settings are related to the OpenSearch cluster.
To learn more about static and dynamic settings, see Configuring OpenSearch.
Cluster-level routing and allocation settings
OpenSearch supports the following cluster-level routing and shard allocation settings. All settings in this list are dynamic:
-
cluster.routing.allocation.enable
(String): Enables or disables allocation for specific kinds of shards.Valid values are:
all
– Allows shard allocation for all types of shards.primaries
– Allows shard allocation for primary shards only.new_primaries
– Allows shard allocation for primary shards for new indexes only.none
– No shard allocations are allowed for any indexes.
Default is
all
. -
cluster.routing.allocation.node_concurrent_incoming_recoveries
(Integer): Configures how many concurrent incoming shard recoveries are allowed to happen on a node. Default is2
. -
cluster.routing.allocation.node_concurrent_outgoing_recoveries
(Integer): Configures how many concurrent outgoing shard recoveries are allowed to happen on a node. Default is2
. -
cluster.routing.allocation.node_concurrent_recoveries
(String): Used to setcluster.routing.allocation.node_concurrent_incoming_recoveries
andcluster.routing.allocation.node_concurrent_outgoing_recoveries
to the same value. -
cluster.routing.allocation.node_initial_primaries_recoveries
(Integer): Sets the number of recoveries for unassigned primaries after a node restart. Default is4
. -
cluster.routing.allocation.same_shard.host
(Boolean): When set totrue
, multiple copies of a shard are prevented from being allocated to distinct nodes on the same host. Default isfalse
. -
cluster.routing.rebalance.enable
(String): Enables or disables rebalancing for specific kinds of shards.Valid values are:
all
– Allows shard balancing for all types of shards.primaries
– Allows shard balancing for primary shards only.replicas
– Allows shard balancing for replica shards only.none
– No shard balancing is allowed for any indexes.
Default is
all
. -
cluster.routing.allocation.allow_rebalance
(String): Specifies when shard rebalancing is allowed.Valid values are:
always
– Always allow rebalancing.indices_primaries_active
– Only allow rebalancing when all primaries in the cluster are allocated.indices_all_active
– Only allow rebalancing when all shards in the cluster are allocated.
Default is
indices_all_active
. -
cluster.routing.allocation.cluster_concurrent_rebalance
(Integer): Allows you to control how many concurrent shard rebalances are allowed across a cluster. Default is2
. -
cluster.routing.allocation.balance.shard
(Floating point): Defines the weight factor for the total number of shards allocated per node. Default is0.45
. -
cluster.routing.allocation.balance.index
(Floating point): Defines the weight factor for the number of shards per index allocated on a node. Default is0.55
. -
cluster.routing.allocation.balance.threshold
(Floating point): The minimum optimization value of operations that should be performed. Default is1.0
. -
cluster.routing.allocation.balance.prefer_primary
(Boolean): When set totrue
, OpenSearch attempts to evenly distribute the primary shards between the cluster nodes. Enabling this setting does not always guarantee an equal number of primary shards on each node, especially in the event of failover. Changing this setting tofalse
after it was set totrue
does not invoke redistribution of primary shards. Default isfalse
. -
cluster.routing.allocation.rebalance.primary.enable
(Boolean): When set totrue
, OpenSearch attempts to rebalance the primary shards between the cluster nodes. When enabled, the cluster tries to maintain the number of primary shards on each node, with the maximum buffer defined by thecluster.routing.allocation.rebalance.primary.buffer
setting. Changing this setting tofalse
after it was set totrue
does not invoke the redistribution of primary shards. Default isfalse
. -
cluster.routing.allocation.rebalance.primary.buffer
(Floating point): Defines the maximum allowed buffer of primary shards between nodes whencluster.routing.allocation.rebalance.primary.enable
is enabled. Default is0.1
. -
cluster.routing.allocation.disk.threshold_enabled
(Boolean): When set tofalse
, disables the disk allocation decider. This will also remove any existingindex.blocks.read_only_allow_delete index blocks
when disabled. Default istrue
. -
cluster.routing.allocation.disk.watermark.low
(String): Controls the low watermark for disk usage. When set to a percentage, OpenSearch will not allocate shards to nodes with that percentage of disk used. This can also be entered as ratio value, like0.85
. Finally, this can also be set to a byte value, like400mb
. This setting does not affect the primary shards of newly created indexes, but will prevent their replicas from being allocated. Default is85%
. -
cluster.routing.allocation.disk.watermark.high
(String): Controls the high watermark. OpenSearch will attempt to relocate shards away from a node whose disk usage is above the percentage defined. This can also be entered as a ratio value, like0.85
. Finally, this can also be set to a byte value, like400mb
. This setting affects the allocation of all shards. Default is90%
. -
cluster.routing.allocation.disk.watermark.flood_stage
(String): Controls the flood stage watermark. This is a last resort to prevent nodes from running out of disk space. OpenSearch enforces a read-only index block (index.blocks.read_only_allow_delete
) on every index that has one or more shards allocated on the node and that has at least one disk exceeding the flood stage. The index block is released once the disk utilization falls below the high watermark. This can also be entered as a ratio value, like0.85
. Finally, this can also be set to a byte value, like400mb
. Default is95%
. -
cluster.info.update.interval
(Time unit): Sets how often OpenSearch should check disk usage for each node in the cluster. Default is30s
. -
cluster.routing.allocation.include.<attribute>
(Enum): Allocates shards to a node whoseattribute
has at least one of the included comma-separated values. -
cluster.routing.allocation.require.<attribute>
(Enum): Only allocates shards to a node whoseattribute
has all of the included comma-separated values. -
cluster.routing.allocation.exclude.<attribute>
(Enum): Does not allocate shards to a node whoseattribute
has any of the included comma-separated values. The cluster allocation settings support the following built-in attributes.Valid values are:
_name
– Match nodes by node name._host_ip
– Match nodes by host IP address._publish_ip
– Match nodes by publish IP address._ip
– Match either_host_ip
or_publish_ip
._host
– Match nodes by hostname._id
– Match nodes by node ID._tier
– Match nodes by data tier role.
-
cluster.routing.allocation.shard_movement_strategy
(Enum): Determines the order in which shards are relocated from outgoing to incoming nodes.This setting supports the following strategies:
PRIMARY_FIRST
– Primary shards are relocated first, before replica shards. This prioritization may help prevent a cluster’s health status from going red if the relocating nodes fail during the process.REPLICA_FIRST
– Replica shards are relocated first, before primary shards. This prioritization may help prevent a cluster’s health status from going red when carrying out shard relocation in a mixed-version, segment-replication-enabled OpenSearch cluster. In this situation, primary shards relocated to OpenSearch nodes of a newer version could try to copy segment files to replica shards on an older version of OpenSearch, which would result in shard failure. Relocating replica shards first may help to avoid this in multi-version clusters.NO_PREFERENCE
– The default behavior in which the order of shard relocation has no importance.
cluster.allocator.gateway.batch_size
(Integer): Limits the number of shards sent to data nodes in one batch for fetching any unassigned shard metadata. Default is2000
.cluster.allocator.existing_shards_allocator.batch_enabled
(Boolean): Enables batch allocation of unassigned shards that already exist on the disk as opposed to allocating one shard at a time. This reduces memory and transport overhead by fetching any unassigned shard metadata in a batch call. Default isfalse
.Cluster-level shard, block, and task settings
OpenSearch supports the following cluster-level shard, block, and task settings:
-
action.search.shard_count.limit
(Integer): Limits the maximum number of shards to be hit during search. Requests that exceed this limit will be rejected. -
cluster.blocks.read_only
(Boolean): Sets the entire cluster to read-only. Default isfalse
. -
cluster.blocks.read_only_allow_delete
(Boolean): Similar tocluster.blocks.read_only
, but allows you to delete indexes. -
cluster.max_shards_per_node
(Integer): Limits the total number of primary and replica shards for the cluster. The limit is calculated as follows:cluster.max_shards_per_node
multiplied by the number of non-frozen data nodes. Shards for closed indexes do not count toward this limit. Default is1000
. -
cluster.persistent_tasks.allocation.enable
(String): Enables or disables allocation for persistent tasks.Valid values are:
all
– Allows persistent tasks to be assigned to nodes.none
– No allocations are allowed for persistent tasks. This does not affect persistent tasks already running.
Default is
all
. -
cluster.persistent_tasks.allocation.recheck_interval
(Time unit): The cluster manager automatically checks whether persistent tasks need to be assigned when the cluster state changes in a significant way. There are other factors, such as memory usage, that will affect whether persistent tasks are assigned to nodes but do not otherwise cause the cluster state to change. This setting defines how often assignment checks are performed in response to these factors. Default is30 seconds
, with a minimum of10 seconds
being required.
Cluster-level slow log settings
For more information, see Search request slow logs.
-
cluster.search.request.slowlog.threshold.warn
(Time unit): Sets the request-level slow logWARN
threshold. Default is-1
. -
cluster.search.request.slowlog.threshold.info
(Time unit): Sets the request-level slow logINFO
threshold. Default is-1
. -
cluster.search.request.slowlog.threshold.debug
(Time unit): Sets the request-level slow logDEBUG
threshold. Default is-1
. -
cluster.search.request.slowlog.threshold.trace
(Time unit): Sets the request-level slow logTRACE
threshold. Default is-1
. -
cluster.search.request.slowlog.level
(String): Sets the minimum slow log level to log:WARN
,INFO
,DEBUG
, andTRACE
. Default isTRACE
.
Cluster-level index settings
For information about index-level index settings, see Cluster-level index settings.
Cluster-level coordination settings
OpenSearch supports the following cluster-level coordination settings. All settings in this list are dynamic:
-
cluster.fault_detection.leader_check.timeout
(Time unit): The amount of time a node waits for a response from the elected cluster manager during a leader check before deeming the check a failure. Valid values are from1ms
to60s
, inclusive. Default is10s
. Changing this setting to a value other than the default can result in an unstable cluster. -
cluster.fault_detection.follower_check.timeout
(Time unit): The amount of time the elected cluster manager waits for a response during a follower check before deeming the check a failure. Valid values are from1ms
to60s
, inclusive. Default is10s
. Changing this setting to a value other than the default can result in an unstable cluster.