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 Swift - 类初始化和反初始化方法(init与deinit)
Swift - 类初始化和反初始化方法(init与deinit)
2
Nginx if多条件判断
Nginx if多条件判断
3
比 Kubernetes Dashboard 更好用的管理工具 - Kuboard
比 Kubernetes Dashboard 更好用的管理工具 - Kuboard
4
npm及yarn设置和取消代理的方法
npm及yarn设置和取消代理的方法
5
Windows下 mysql-8.x-winx64 安装
Windows下 mysql-8.x-winx64 安装
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。