今天生产环境logstash与elasticsearch出现“cluster_block_exception“报错的问题,
logstash报错现象
[2018-12-26T16:18:06,709][INFO ][logstash.outputs.elasticsearch] retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"})
elasticsearch报错现象
[2018-12-26T08:00:00,434][WARN ][o.e.x.m.e.l.LocalExporter] unexpected error while indexing monitoring document org.elasticsearch.xpack.monitoring.exporter.ExportException: ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
经过排查,解决方法
curl -XPUT -H "Content-Type: application/json" http://10.1.3.80:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
10.1.3.80为es的地址
注:es的硬盘使用率不要超过95%