• 【ElasticSearch】index read-only


    今天在测试环境执行MySQL数据同步到ElasticSearch中时,出现无法写入的问题,并且提示

    [FORBIDDEN/12/index read-only / allow delete (api)

    排查后发现是ES所在服务器磁盘空间不足,导致索引无法写入,解决方式:

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

    2.重置修改只读索引块

    在Kibana上修改,如下

    某一个索引重置只读模块
    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

  • 相关阅读:
    第一部分 题目要求
    完全卸载oracle
    zabbix的面试题目总结
    性能优化之MySQL调优篇
    select与epoll、apache与nginx实现原理对比
    深度优化LNMP之PHP
    深度优化LNMP之Nginx (转)
    git常用命令
    ansible 安装与卸载软件
    java8两个List集合取交集、并集、差集、去重并集
  • 原文地址:https://www.cnblogs.com/july-sunny/p/15121440.html
Copyright © 2020-2023  润新知