1. 问题描述
logstash写es大量报错,主要内容如下:
retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
2. 解决方案
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
也可以直接在kibana的console中直接运行以下命令:
PUT /_all/_settings
{"index.blocks.read_only_allow_delete": null}
3. 问题原因
主要是因为磁盘不够用了。Elasticsearch磁盘占用大于95%时将所有索引置为只读。如果你自己手动删除了数据,Elasticsearch不会给你自动切换回来,不过你可以手动去修改。就是用上面的命令就好了。
4. 相关资料
- https://discuss.elastic.co/t/...
- https://discuss.elastic.co/t/...
- https://benjaminknofe.com/blo...
- https://blog.csdn.net/cxcjoke...
- https://www.elastic.co/guide/...