解决Elasticsearch索引只读(read-only)

原因为:es 的设置默认是 85% 和 90 %,95%

当为85%时:Elasticsearch不会将碎片分配给磁盘使用率超过85%的节点( cluster.routing.allocation.disk.watermark.low)

当为90%时:Elasticsearch尝试重新分配给磁盘低于使用率90%的节点(cluster.routing.allocation.disk.watermark.high)

当为85%时:Elasticsearch执行只读模块(cluster.routing.allocation.disk.watermark.flood_stage)

1、扩大磁盘或者删除部分历史索引

2、重置改只读索引快

复制代码
某一个索引重置只读模块
PUT /twitter/_settings { "index.blocks.read_only_allow_delete": null }
所有索引重置只读模块
PUT /_all/_settings
{
  "index.blocks.read_only_allow_delete": null
}
PUT /_cluster/settings
{
  "persistent" : {
    "cluster.blocks.read_only" : false
  }
}
复制代码

修改默认设置

复制代码
可以修改为具体的磁盘空间值,也可以修改为百分之多少
临时修改
PUT _cluster/settings { "transient": { "cluster.routing.allocation.disk.watermark.low": "100gb", "cluster.routing.allocation.disk.watermark.high": "50gb", "cluster.routing.allocation.disk.watermark.flood_stage": "10gb", "cluster.info.update.interval": "1m" } }
永久修改
PUT _cluster/settings { "persistent": { "cluster.routing.allocation.disk.watermark.low": "100gb", "cluster.routing.allocation.disk.watermark.high": "50gb", "cluster.routing.allocation.disk.watermark.flood_stage": "10gb", "cluster.info.update.interval": "1m" } }
 
复制代码

转载自:https://www.elastic.co/guide/en/elasticsearch/reference/6.8/disk-allocator.html

posted @   fat_girl_spring  阅读(8221)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示