【问题标题】:Elasticsearch not accepting dataElasticsearch 不接受数据
【发布时间】:2018-09-26 20:43:17
【问题描述】:

我在 kubernetes 上有一个 Elasticsearch 集群 setup。最近,logstash 无法将任何数据推送到集群,因为集群中的一个节点磁盘空间不足。

这是logstash中的错误

 [Ruby-0-Thread-13@[main]>worker1: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:383] elasticsearch - retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}) 

es-master 将节点标记为只读,因为可用磁盘空间超过阈值

[WARN ][o.e.c.r.a.DiskThresholdMonitor] [es-master-65ccf55794-pm4xz] flood stage disk watermark [95%] exceeded on [SaRCGuyyTBOxTjNtvjui-g][es-data-1][/data/data/nodes/0] free: 9.1gb[2%], all indices on this node will be marked read-only

之后,我释放了该节点上的资源,现在它有足够的可用空间(几乎 50%)。但是 logstash 仍然无法将数据推送到弹性搜索,并且正在记录上述相同的错误。

我有以下问题

  1. elasticsearch 会自动从中恢复吗?
  2. 如果不是,我应该重新启动集群吗?只重启数据节点就够了吗,还是应该同时重启master和indest节点?
  3. 有什么方法可以在不重新启动的情况下将索引标记为可再次写入?

【问题讨论】:

    标签: elasticsearch logstash


    【解决方案1】:

    您必须手动重置索引上的只读块。

    您可以在cluster.routing.allocation.disk.watermark.flood_stage 块中查看文档here

    一旦有足够的磁盘,必须手动释放索引块 可用于允许索引操作继续进行的空间。

    PUT /<your index name>/_settings
    {
      "index.blocks.read_only_allow_delete": null
    }
    

    【讨论】:

    • 这是为所有索引设置它的方式:curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
    猜你喜欢
    • 2021-09-01
    • 2016-12-01
    • 2016-02-04
    • 1970-01-01
    • 2015-12-16
    • 2018-02-15
    • 2019-09-08
    • 2022-01-24
    • 2018-06-15
    相关资源
    最近更新 更多