Elasticsearch错误Exceeded flood-stage watermark导致index has read-only-allow-delete block
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的值
更多推荐
所有评论(0)