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

相关推荐
Elastic 中国社区官方博客4 小时前
使用真实 Elasticsearch 进行高级集成测试
大数据·数据库·elasticsearch·搜索引擎·全文检索·jenkins·集成测试
画船听雨眠aa12 小时前
gitlab云服务器配置
服务器·git·elasticsearch·gitlab
risc12345616 小时前
【Elasticsearch 】悬挂索引(Dangling Indices)
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客17 小时前
使用 Ollama 和 Kibana 在本地为 RAG 测试 DeepSeek R1
大数据·数据库·人工智能·elasticsearch·ai·云原生·全文检索
zfj32117 小时前
学技术学英语:elasticsearch硬件相关的配置&优化技巧
网络·elasticsearch·全文检索·内存·cpu·磁盘
字节全栈_vBr1 天前
面试之Solr&Elasticsearch
elasticsearch·面试·solr
risc1234561 天前
【Elasticsearch】中数据流需要配置索引模板吗?
大数据·elasticsearch·jenkins
JackieZhengChina1 天前
新一代搜索引擎,是 ES 的15倍?
大数据·elasticsearch·搜索引擎
是小崔啊1 天前
Spring Boot - 数据库集成06 - 集成ElasticSearch
数据库·spring boot·elasticsearch
Elastic 中国社区官方博客1 天前
Elastic Cloud Serverless 获得主要合规认证
大数据·数据库·elasticsearch·搜索引擎·云原生·serverless·全文检索