ES Error

retrying failed action with response code: 403 ({“type”=>”cluster_block_exception”, “reason”=>”blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];”})

Cause: 当某个数据节点的存储空间超过95%时,如果此时再分配分片的索引进来,那么该索引将强制进入只读模式。

Solution:

  1. 在 Kibana 开发控制台执行

    1
    2
    3
    4
    5
    6
    7
    8
    PUT _settings
    {
    "index": {
    "blocks": {
    "read_only_allow_delete": "false"
    }
    }
    }
  2. 使用 API 接口设置

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

https://www.aityp.com/%E8%A7%A3%E5%86%B3elasticsearch%E7%B4%A2%E5%BC%95%E5%8F%AA%E8%AF%BB/

Can’t write data to es data

Solution: es 磁盘写满之后 会自动被设置成read only ,清理索引之后,在kibana 的dev tools页面里 执行以下转为可写

1
2
3
4
5
6
7
8
PUT _settings
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}