Sure thing. The number_of_replicas
setting is immediately overwritten to 0 in this case
PUT /testing_auto_expand_replicas
{
"settings": {
"auto_expand_replicas": "0-all",
"index.routing.allocation.include._tier_preference": null,
"number_of_replicas": 2
}
}
GET /testing_auto_expand_replicas/_settings
{
"testing_auto_expand_replicas" : {
"settings" : {
"index" : {
"number_of_shards" : "1",
"auto_expand_replicas" : "0-all",
"provided_name" : "testing_auto_expand_replicas",
"max_inner_result_window" : "10000",
"creation_date" : "1662468286411",
"number_of_replicas" : "0",
"uuid" : "Ed1l4I8aS7ywEI0BNpuNwA",
"version" : {
"created" : "7170199"
}
}
}
}
}
And the allocation explain, in case you need it
{
"index" : "testing_auto_expand_replicas",
"shard" : 0,
"primary" : true,
"current_state" : "started",
"current_node" : {
"id" : "PS1WfPGWS4KvFDJbACEG4A",
"name" : "es-01.stordata.dc",
"transport_address" : "10.254.249.10:9300",
"attributes" : {
"ml.machine_memory" : "135075225600",
"ml.max_open_jobs" : "512",
"xpack.installed" : "true",
"ml.max_jvm_size" : "33285996544",
"transform.node" : "true"
},
"weight_ranking" : 1
},
"can_remain_on_current_node" : "yes",
"can_rebalance_cluster" : "yes",
"can_rebalance_to_other_node" : "no",
"rebalance_explanation" : "cannot rebalance as no target node exists that can both allocate this shard and improve the cluster balance",
"node_allocation_decisions" : [
{
"node_id" : "NeLqOXVAQa-38GN1jWyn_Q",
"node_name" : "es-03.stordata.dc",
"transport_address" : "10.254.249.12:9300",
"node_attributes" : {
"ml.machine_memory" : "135075368960",
"ml.max_open_jobs" : "512",
"xpack.installed" : "true",
"ml.max_jvm_size" : "33285996544",
"transform.node" : "true"
},
"node_decision" : "worse_balance",
"weight_ranking" : 1,
"deciders" : [
{
"decider" : "max_retry",
"decision" : "YES",
"explanation" : "shard has no previous failures"
},
{
"decider" : "replica_after_primary_active",
"decision" : "YES",
"explanation" : "shard is primary and can be allocated"
},
{
"decider" : "enable",
"decision" : "YES",
"explanation" : "all allocations are allowed"
},
{
"decider" : "node_version",
"decision" : "YES",
"explanation" : "can relocate primary shard from a node with version [7.17.1] to a node with equal-or-newer version [7.17.1]"
},
{
"decider" : "snapshot_in_progress",
"decision" : "YES",
"explanation" : "no snapshots are currently running"
},
{
"decider" : "restore_in_progress",
"decision" : "YES",
"explanation" : "ignored as shard is not being recovered from a snapshot"
},
{
"decider" : "node_shutdown",
"decision" : "YES",
"explanation" : "this node is not currently shutting down"
},
{
"decider" : "node_replacement",
"decision" : "YES",
"explanation" : "neither the source nor target node are part of an ongoing node replacement (no replacements)"
},
{
"decider" : "filter",
"decision" : "YES",
"explanation" : "node passes include/exclude/require filters"
},
{
"decider" : "same_shard",
"decision" : "YES",
"explanation" : "this node does not hold a copy of this shard"
},
{
"decider" : "disk_threshold",
"decision" : "YES",
"explanation" : "enough disk for shard on node, free: [1.3tb], shard size: [226b], free after allocating shard: [1.3tb]"
},
{
"decider" : "throttling",
"decision" : "YES",
"explanation" : "below shard recovery limit of outgoing: [0 < 4] incoming: [0 < 4]"
},
{
"decider" : "shards_limit",
"decision" : "YES",
"explanation" : "total shard limits are disabled: [index: -1, cluster: -1] <= 0"
},
{
"decider" : "awareness",
"decision" : "YES",
"explanation" : "allocation awareness is not enabled, set cluster setting [cluster.routing.allocation.awareness.attributes] to enable it"
},
{
"decider" : "data_tier",
"decision" : "YES",
"explanation" : "node passes include/exclude/require/prefer tier filters"
},
{
"decider" : "ccr_primary_follower",
"decision" : "YES",
"explanation" : "shard is not a follower and is not under the purview of this decider"
},
{
"decider" : "searchable_snapshots",
"decision" : "YES",
"explanation" : "decider only applicable for indices backed by searchable snapshots"
},
{
"decider" : "searchable_snapshot_repository_exists",
"decision" : "YES",
"explanation" : "this decider only applies to indices backed by searchable snapshots"
},
{
"decider" : "searchable_snapshots_enable",
"decision" : "YES",
"explanation" : "decider only applicable for indices backed by searchable snapshots"
},
{
"decider" : "dedicated_frozen_node",
"decision" : "YES",
"explanation" : "this node's data roles are not exactly [data_frozen] so it is not a dedicated frozen node"
}
]
},
{
"node_id" : "qZMbs-d_QcOGh3Ve2DS1ug",
"node_name" : "es-02.stordata.dc",
"transport_address" : "10.254.249.11:9300",
"node_attributes" : {
"ml.machine_memory" : "135075360768",
"ml.max_open_jobs" : "512",
"xpack.installed" : "true",
"ml.max_jvm_size" : "33285996544",
"transform.node" : "true"
},
"node_decision" : "worse_balance",
"weight_ranking" : 1,
"deciders" : [
{
"decider" : "max_retry",
"decision" : "YES",
"explanation" : "shard has no previous failures"
},
{
"decider" : "replica_after_primary_active",
"decision" : "YES",
"explanation" : "shard is primary and can be allocated"
},
{
"decider" : "enable",
"decision" : "YES",
"explanation" : "all allocations are allowed"
},
{
"decider" : "node_version",
"decision" : "YES",
"explanation" : "can relocate primary shard from a node with version [7.17.1] to a node with equal-or-newer version [7.17.1]"
},
{
"decider" : "snapshot_in_progress",
"decision" : "YES",
"explanation" : "no snapshots are currently running"
},
{
"decider" : "restore_in_progress",
"decision" : "YES",
"explanation" : "ignored as shard is not being recovered from a snapshot"
},
{
"decider" : "node_shutdown",
"decision" : "YES",
"explanation" : "node [qZMbs-d_QcOGh3Ve2DS1ug] is preparing to restart, but will remain in the cluster"
},
{
"decider" : "node_replacement",
"decision" : "YES",
"explanation" : "neither the source nor target node are part of an ongoing node replacement (no replacements)"
},
{
"decider" : "filter",
"decision" : "YES",
"explanation" : "node passes include/exclude/require filters"
},
{
"decider" : "same_shard",
"decision" : "YES",
"explanation" : "this node does not hold a copy of this shard"
},
{
"decider" : "disk_threshold",
"decision" : "YES",
"explanation" : "enough disk for shard on node, free: [1.3tb], shard size: [226b], free after allocating shard: [1.3tb]"
},
{
"decider" : "throttling",
"decision" : "YES",
"explanation" : "below shard recovery limit of outgoing: [0 < 4] incoming: [0 < 4]"
},
{
"decider" : "shards_limit",
"decision" : "YES",
"explanation" : "total shard limits are disabled: [index: -1, cluster: -1] <= 0"
},
{
"decider" : "awareness",
"decision" : "YES",
"explanation" : "allocation awareness is not enabled, set cluster setting [cluster.routing.allocation.awareness.attributes] to enable it"
},
{
"decider" : "data_tier",
"decision" : "YES",
"explanation" : "node passes include/exclude/require/prefer tier filters"
},
{
"decider" : "ccr_primary_follower",
"decision" : "YES",
"explanation" : "shard is not a follower and is not under the purview of this decider"
},
{
"decider" : "searchable_snapshots",
"decision" : "YES",
"explanation" : "decider only applicable for indices backed by searchable snapshots"
},
{
"decider" : "searchable_snapshot_repository_exists",
"decision" : "YES",
"explanation" : "this decider only applies to indices backed by searchable snapshots"
},
{
"decider" : "searchable_snapshots_enable",
"decision" : "YES",
"explanation" : "decider only applicable for indices backed by searchable snapshots"
},
{
"decider" : "dedicated_frozen_node",
"decision" : "YES",
"explanation" : "this node's data roles are not exactly [data_frozen] so it is not a dedicated frozen node"
}
]
}
]
}