logstash.outputs.elasticsearch retrying failed action with response code 403

在用Logstash收集应用数据到ElasticSearch中时,运行一段时间后就出错:

[root@appblog.cn logstash]# tail -f logs/logstash-plain.log 
[2021-02-20T17:09:26,878][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)];"})
[2021-02-20T17:09:26,878][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)];"})
[2021-02-20T17:09:26,879][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)];"})
[2021-02-20T17:09:26,879][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)];"})
[2021-02-20T17:09:26,879][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)];"})
[2021-02-20T17:09:26,880][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)];"})
[2021-02-20T17:09:26,880][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)];"})
[2021-02-20T17:09:26,880][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)];"})
[2021-02-20T17:09:26,881][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)];"})

按照 Eleastisearch 官方文档给的解决办法是

An example of resetting the read-only index block on the twitter index:

PUT /twitter/_settings
{
  "index.blocks.read_only_allow_delete": null
}

官方链接: https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html

按照官方给的这个解决思路,在Linux上执行:

curl -XPUT -H 'Content-Type: application/json' http://192.168.1.8:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

其中_all可以更改为自己在创建 ElasticSearch 索引的时候的name,用来修改单个索引只读状态,当然用_all是修改所有的索引只读状态

上一篇 Logstash filter target操作之后remove_field删除子字段
下一篇 Filebeat自动关闭问题解决
目录
文章列表
1 深度学习基础:线性代数(4)_范数
深度学习基础:线性代数(4)_范数
2
Swift UI - 带结果列表的搜索条(UISearchDisplayController)的用法
Swift UI - 带结果列表的搜索条(UISearchDisplayController)的用法
3
解决爱思助手iPhone刷机卡百分之60验证Savage卡验证固件最后报错53方法
解决爱思助手iPhone刷机卡百分之60验证Savage卡验证固件最后报错53方法
4
设计模式(8)状态模式
设计模式(8)状态模式
5
uni-app Markdown相关插件
uni-app Markdown相关插件
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。