es索引分片重新分配cluster.routing.allocation

本文介绍了Elasticsearch中用于控制索引分片分配的过滤规则,包括index.routing.allocation.include,require和exclude设置。这些设置允许基于节点的属性如名称、IP地址、主机名、节点ID和数据层角色来指定索引应分配到哪些节点。例如,可以设定将索引分配给具有特定大小存储的节点,排除特定IP范围的节点,或者要求节点必须在特定的数据层和机架上。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Index-level shard allocation filtering | Elasticsearch Guide [master] | Elastic

index.routing.allocation.include.{attribute}

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

index.routing.allocation.require.{attribute}

Assign the index to a node whose {attribute} has all of the comma-separated values.

index.routing.allocation.exclude.{attribute}

Assign the index to a node whose {attribute} has none of the comma-separated values.

The index allocation settings support the following built-in attributes:

_name

Match nodes by node name

_host_ip

Match nodes by host IP address (IP associated with hostname)

_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 the node’s data tier role. For more details see data tier allocation filtering

PUT test/_settings
{
  "index.routing.allocation.include.size": "big,medium"
}

PUT test/_settings
{
  "index.routing.allocation.exclude._ip": "192.168.2.*,192.168.3.*"
}

PUT test/_settings
{
  "index.routing.allocation.require.size": "big",
  "index.routing.allocation.require.rack": "rack1"
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值