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 中国社区官方博客2 小时前
Elasticsearch 中使用 NVIDIA cuVS 实现最高快 12 倍的向量索引速度:GPU 加速第 2 章
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索·数据库架构
微扬嘴角7 小时前
springcloud篇7-ElasticSearch分布式搜索
elasticsearch·spring cloud
Elastic 中国社区官方博客7 小时前
Elasticsearch 中的文档级基于属性的访问控制 - ABAC
大数据·数据库·elasticsearch·搜索引擎·全文检索
IT机器猫8 小时前
ES基础一
大数据·elasticsearch·搜索引擎
Wang's Blog8 小时前
Elastic Stack梳理: 聚合分析核心技术深度解析与最佳实践
elasticsearch·搜索引擎·es·elastic search
Elastic 中国社区官方博客8 小时前
EDB EPAS 通过 PostgreSQL 连接器同步数据到 Elasticsearch
大数据·数据库·人工智能·elasticsearch·搜索引擎·postgresql·全文检索
武子康10 小时前
大数据-174 Elasticsearch 查询 DSL 实战:match/match_phrase/query_string/multi_match 全解析
大数据·后端·elasticsearch
jiayong2311 小时前
Elasticsearch 核心概念详解:Index、Document、Field
大数据·elasticsearch·jenkins
j***518912 小时前
使用Canal将MySQL数据同步到ES(Linux)
linux·mysql·elasticsearch
知秋正在99613 小时前
ElasticSearch索引red,关键字 Too many open files
大数据·elasticsearch·搜索引擎