31-Shard Allocation Awareness(机架感知)

同一机器上,部署多个es节点,防止副本和主分片分配到同一机器上

例如:es节点a、b、c部署在01机器上,节点d、e、f部署在02机器上

es2.4版本配置

a、b、c节点yaml配置:node.rack: aaa

d、e、f节点yaml配置:node.rack: bbb

调用api设置机架感知生效,"cluster.routing.allocation.awareness.attributes": "rack"

集群会重分配部分分片。当部分多于node节点数时,无法分配。

复制代码
curl --location 'http://es:9200/_cluster/settings' \
--data ''

curl --location --request PUT 'http://es:9200/_cluster/settings' \
--header 'Content-Type: application/json' \
--data '{
    "persistent": {
        "cluster.routing.allocation.awareness.attributes": "rack"
    }
}'

参考文档:Shard Allocation Awareness | Elasticsearch Guide [2.4] | Elastic

相关推荐
Yusei_052312 分钟前
迅速掌握Git通用指令
大数据·git·elasticsearch
水无痕simon18 小时前
5 索引的操作
数据库·elasticsearch
Qlittleboy3 天前
tp5集成elasticsearch笔记
大数据·笔记·elasticsearch
Elasticsearch3 天前
Elasticsearch:使用 Gradio 来创建一个简单的 RAG 应用界面
elasticsearch
kong@react3 天前
spring boot配置es
spring boot·后端·elasticsearch
Elasticsearch3 天前
Elasticsearch:如何使用 Qwen3 来做向量搜索
elasticsearch
Elastic 中国社区官方博客3 天前
Elasticsearch:如何使用 Qwen3 来做向量搜索
大数据·人工智能·elasticsearch·搜索引擎·全文检索
xiao-xiang4 天前
elasticsearch mapping和template解析(自动分词)!
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客4 天前
超越相似名称:Elasticsearch semantic text 如何在简洁、高效、集成方面超越 OpenSearch semantic 字段
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
现在,此刻4 天前
java面试题储备4: 谈谈对es的理解
java·开发语言·elasticsearch