背景

一个两年前的读书笔记项目,在本地开发环境启动后,搜索服务的后端日志 ElasticSearch 报错:FORBIDDEN/12/index read-only / allow delete (api)无法写入。

type=cluster_block_exception, reason=index [book] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

问题排查

  • Head插件

这时,通过Head插件查看 ElasticSearch 状态为 Yellow ,天哪,集群状态黄了,就问你慌不慌。。

  • ElasticSearch日志

通过查看 ElasticSearch 的日志,可以发现持续输出一些警告:

[2022-09-29T20:18:10,288][WARN ][o.e.c.r.a.DiskThresholdMonitor] [master] high disk watermark [90%] exceeded on [b9XZhdztSIivHYpah48Fcg][master][D:\Installed\ElasticSearch7\elasticsearch-7.5.2\data\nodes\0] free: 23.1gb[6.6%], shards will be relocated away from this node
[2022-09-29T20:18:10,513][INFO ][o.e.c.r.a.DiskThresholdMonitor] [master] rerouting shards: [high disk watermark exceeded on one or more nodes]

原来是因为我的机器磁盘空间用量超过了90%,可怜的硬盘只剩下23.1gb[6.6%]。

解决方案

当磁盘空间不足 90% 时, Elasticsearch 认为这种节点的服务能力不足了。然后, Elasticsearch 不会将数据片分配给使用了超过90%磁盘的节点。所以会出现上述错误。

curl -X PUT "localhost:9200/book/_settings?pretty" -H 'Content-Type: application/json' -d'
{"index.blocks.read_only_allow_delete": null
}'

小总结

竟然是由于硬盘空间不足导致的 ElasticSearch 高水位报错,这种问题一般不好排查,特此记录。附:以前写的关于ElasticSearch的内容,包含 ElasticSearch8.0 分布式搜索引擎集群及其高可用测试。

  • ElasticSearch入门(一)单节点初体验
  • ElasticSearch入门(二)批量导入数据(Postman与Kibana)
  • ElasticSearch入门(三)Logstash实现MySQL数据同步至ElasticSearch
  • ElasticSearch入门(四)常用插件:Head插件与ik分词器
  • ElasticSearch入门(五)SpringBoot2.3.0集成ElasticSearch7.5.2-HighLevelClient
  • ElasticSearch入门(六)SpringBoot2.3.0集成ElasticSearch7.5.2-SpringData
  • ElasticSearch入门(七)搭建ElasticSearch集群
  • 在华为鲲鹏openEuler20.03系统上安装ElasticSearch
  • 将最新版的ElasticSearch8与Kibana8在CentOS7上跑起来
  • 全栈开发之ElasticSearch8.0分布式搜索引擎集群及其高可用测试

Reference

  • https://blog.csdn.net/UbuntuTouch/article/details/119748732
  • https://www.elastic.co/guide/en/elasticsearch/reference/master/disk-usage-exceeded.html
  • https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-cluster.html#cluster-routing-watermark-high

If you have any questions or any bugs are found, please feel free to contact me.

Your comments and suggestions are welcome!

ElasticSearch报错:FORBIDDEN/12/index read-only / allow delete (api)无法写入相关推荐

  1. es数据无法写入,报错[FORBIDDEN/12/index read-only / allow delete (api)]

    环境: filebeat , kafka, logstash , elastic search ,版本7.4套件. 问题: logstash 写数据到es报错,如下图 分析: 查看了es安装目录的磁盘 ...

  2. elasticsearch报错“reason“: “Invalid index name [mieShop], must be lowercase

    elasticsearch索引名不支持大写改为小写即可

  3. ES报错:org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [FORBIDDEN/12/index read-onl

    org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [FORBIDDEN/12/index read-only / a ...

  4. 记录使用Elasticsearch报错:FORBIDDEN/12/index read-only / allow delete (api)];]; nested exception is Elasti

    错误问题:FORBIDDEN/12/index read-only / allow delete (api)];]; nested exception is Elasti 原因:磁盘空间不足 解决方法 ...

  5. elasticsearch报错index read-only

    背景 线上服务器的Elasticsearch服务大量报错,查询数据没问题,但是新增或者修改数据时,返回如下错误: {"error": {"root_cause" ...

  6. Elasticsearch - cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]

    文章目录 Error 修复 扩展 Error {"error": "{\"type\":\"cluster_block_exception\ ...

  7. 启动ElasticSearch报错:error updating geoip database

    问题描述: 启动ElasticSearch报错: error updating geoip database [2021-12-22T21:07:11,944][INFO ][o.e.i.g.GeoI ...

  8. elasticsearch报错expected <block end>, but found BlockMappingStart解决方法

    elasticsearch报错expected , but found BlockMappingStart解决方法 参考文章: (1)elasticsearch报错expected , but fou ...

  9. ./mysql-bin.index_MySQL 启动报错:File ./mysql-bin.index not found (Errcode: 13)

    Linux下安装初始化完MySQL数据库之后,使用mysqld_safe启动mysql数据库,如下发现,启动失败 [root@SVNServer bin]# ./mysqld_safe –user=m ...

最新文章

  1. windows性能计数器搜集方法
  2. WIN7如何替换开机登录画面
  3. Leetcode 107.二叉树的层序遍历 II (每日一题 20210628 同类型题)
  4. 双因素方差分析_多因素方差分析
  5. 流动python - 字符串KMP匹配
  6. decimal,float和double的区别
  7. about semget
  8. HTML5移动端最新兼容问题解决方案
  9. Cadence学习之路(八)画PCB前你必须知道的事情!
  10. 小米android手机怎么刷机,小米手机要刷机如何进入recovery模式
  11. 前端要点总结1(2021-12)
  12. Qt 5.12--color
  13. Spring Microservices in Action中文版
  14. DxO PhotoLab 4.2Crack,使用独特的DxO本地调整工具
  15. mysql left join含义_left join是什么意思
  16. 董明珠的权力危机:半年两位元老出局,格力进入动荡时刻
  17. wps公式如何加序号_WPS表格函数——vlookup出现错误的四种情况及解决办法
  18. 常见的文件系统格式(带你快速了解)
  19. MySQL中常用的SQL优化方法
  20. omnet++仿真软件会从运行模拟开始

热门文章

  1. EUV光刻机内部揭秘!
  2. 查看 Redis 某种类型的所有 key
  3. Android 接入穿山甲SDK之插屏广告
  4. 这样的心态,值得拥有
  5. 搬运视频怎么做成原创 | 短视频批量伪原创
  6. 【英语:基础进阶_听口实战运用】D1.听口实战运用
  7. 爬虫学习笔记(用python爬取东方财富网实验)
  8. 10分钟!Mac配置Win主机上的共享打印机
  9. arcgis取消投影_ArcGIS中的投影问题
  10. Python编程练习:斐波那契数列