While Index Shard Allocation provides per-index settings to control the
allocation of shards to nodes, cluster-level shard allocation filtering allows
you to allow or disallow the allocation of shards from any index to
particular nodes.

The available dynamic cluster settings are as follows, where {attribute}
refers to an arbitrary node attribute.:

cluster.routing.allocation.include.{attribute}

Allocate shards to a node whose {attribute} has at least one of the
comma-separated values.

cluster.routing.allocation.require.{attribute}

Only allocate shards to a node whose {attribute} has all of the
comma-separated values.

cluster.routing.allocation.exclude.{attribute}

Do not allocate shards to a node whose {attribute} has any of the
comma-separated values.

These special attributes are also supported:

_name

Match nodes by node names

_ip

Match nodes by IP addresses (the IP address associated with the hostname)

_host

Match nodes by hostnames

The typical use case for cluster-wide shard allocation filtering is when you
want to decommission a node, and you would like to move the shards from that
node to other nodes in the cluster before shutting it down.

For instance, we could decommission a node using its IP address as follows: