Elasticsearch错误Exceeded flood-stage watermark导致index has read-only-allow-delete block
Posted 小小小小阔爱了啦
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch错误Exceeded flood-stage watermark导致index has read-only-allow-delete block相关的知识,希望对你有一定的参考价值。
Elasticsearch错误Exceeded flood-stage watermark导致index has read-only-allow-delete block,即超出了洪水阶段磁盘水印,导致索引被锁定后索引仅为只读状态,使得修改修改、数据插入等操作均报此类错误,解决办法为先设置洪水水印值再解锁索引,具体步骤如下:
1.设置洪水水印值
设置洪水印值方法一:直接修改elasticsearch.yml文件,加入或修改以下配置:
cluster.routing.allocation.disk.threshold_enabled: true
cluster.routing.allocation.disk.watermark.flood_stage: 4gb
cluster.routing.allocation.disk.watermark.low: 4gb
cluster.routing.allocation.disk.watermark.high: 4gb
修改elasticsearch.yml文件之后需要重启ES。
设置洪水水印值方法二:
PUT http://ip:port/_cluster/settings
"transient":"cluster.routing.allocation.disk.threshold_enabled": true,
"cluster.routing.allocation.disk.watermark.low": "4gb",
"cluster.routing.allocation.disk.watermark.high": "4gb",
"cluster.routing.allocation.disk.watermark.flood_stage": "4gb"
2.解锁索引
PUT http://ip:port/_all/_settings
"index.blocks.read_only_allow_delete":null
_all表示解除所有索引,如果要解锁指定索引,则把_all改成具体的索引名称。
注意事项:
①设置大小不得超过磁盘剩余空间大小,否则可能导致无效;
②cluster.routing.allocation.disk.watermark.low的值需要大于等于cluster.routing.allocation.disk.watermark.high的值
以上是关于Elasticsearch错误Exceeded flood-stage watermark导致index has read-only-allow-delete block的主要内容,如果未能解决你的问题,请参考以下文章
python RecursionError: maximum recursion depth exceeded in comparison错误
python RecursionError: maximum recursion depth exceeded in comparison错误
Max retries exceeded with url错误