Elasticsearch 磁盘分区触发的低水印设置

问题描述

我的索引处于“黄色”状态,因为有一个分片未分配。我的三个数据节点总体上有足够的磁盘空间,但它们是分区的。每个数据节点都有三个磁盘分区,分别称为 /data1/data2/data3。 Elasticsearch 仅在 /data1 上存储分片。按照手册中的 this page,我修改了头节点上的 elasticsearch.yml 以包含以下内容:

path.data: /data1/elasticsearch,/data2/elasticsearch_2,/data3/elasticsearch_3

然后跑:

curl -XPOST "localhost:9200/_cluster/reroute?retry_failed"

尝试重新分配碎片。但是,我收到来自节点的警告 the node is above the low watermark cluster setting [cluster.routing.allocation.disk.watermark.low=85% 和来自第三个数据节点的 the shard cannot be allocated to the same node on which a copy of the shard already exists

该集群上还有一个小得多的索引,处于绿色状态。

我的问题是,当第一个分区已满时,如何让 Elasticsearch 在数据节点的附加分区上存储分片?每个分区本身都足够大,可以存储一个分片,但我认为因为我在一个分区中有多个索引的数据,它会触发警告并阻止副本分片的分发。

解决方法

当簇为黄色时索引不能重定位。我建议将 number_of_replica 设置为 0,将 set cluster.routing.allocation.disk.watermark.lowcluster.routing.allocation.disk.watermark.high 设置为 95%。然后等待索引重新定位。然后将这些设置设为默认值(1、85%、95%)。

注意 cluster.routing.allocation.total_shards_per_node 默认为 -1 并检查其值。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...