Elasticsearch - cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]

2021-08-17 10:28:23 浏览数 (1)

文章目录

  • Error
  • 修复
  • 扩展

Error

代码语言:javascript复制
{
    "error": "{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}",
    "errorReason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];",
    "errorType": "cluster_block_exception",
    "id": "lpH2aXkBdAyiAR22_Nsh",
    "index": "artisan",
    "operation": "index",
    "status": 403,
    "type": "artisan"
}

修复

在kibana中执行

代码语言:javascript复制
PUT artisan/_settings
{
  "index.blocks.read_only_allow_delete": null
}

执行完以后 无需重启

或者主机上直接执行如下command

代码语言:javascript复制
curl -X PUT "localhost:9200/twitter/_settings?pretty" -H 'Content-Type: application/json' -d'
{
  "index.blocks.read_only_allow_delete": null
}
'
代码语言:javascript复制
curl -XPUT -H "Content-Type: application/json"  http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

扩展

6.4版本的 官方文档:https://www.elastic.co/guide/en/elasticsearch/reference/6.4/disk-allocator.html

代码语言:javascript复制
curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
  "transient": {
    "cluster.routing.allocation.disk.watermark.low": "100gb",
    "cluster.routing.allocation.disk.watermark.high": "50gb",
    "cluster.routing.allocation.disk.watermark.flood_stage": "10gb",
    "cluster.info.update.interval": "1m"
  }
}
'

0 人点赞