如何在 spring 数据 elasticsearch 中禁用磁盘水印分配

How to disable disk watermark allocation in spring data elasticsearch

我在我的 spring 引导应用程序中使用 spring-数据弹性搜索,我在我自己的机器上工作,其中超过 90% 的硬盘被占用。

Elastic search 不会插入任何数据,因为我的硬盘已经使用了 90%,而我只使用了 1 个分片,所以现在我需要禁用分配,当然在生产中我会使用分配。

我已经尝试在 application.properties

中使用分配 属性
cluster.routing.allocation.disk.threshold_enabled = false

我也试过将高阈值提高到 99%

cluster.routing.allocation.disk.watermark.high= .99

但是两者都不起作用,知道如何禁用它吗?

我能够使用此 属性

覆盖默认值
spring.data.elasticsearch.properties.cluster.routing.allocation.disk.watermark.high= .99