elasticsearch报错FORBIDDEN/12/index read-only / allow delete
在用logstash收集mysql数据到elasticsearch中时,运行一段时间后就出错:
[2022-08-08T18:03:19,143][INFO ][logstash.outputs.elasticsearch] retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"index [my-index-000001] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"})
查看es的文档后,发现应该是es磁盘空间大于95%,只能查询和删除,所以写入失败了。
解决:
1.首先清理磁盘空间
2.然后发现还是拒绝,需要手动取消索引的只读模式
可以执行以下命令:
PUT /my-index-000001/_settings { "index.blocks.read_only_allow_delete": null }