Elasticsearch - cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]
Posted 小小工匠
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch - cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]相关的知识,希望对你有一定的参考价值。
Error
{
"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中执行
PUT artisan/_settings
{
"index.blocks.read_only_allow_delete": null
}
执行完以后 无需重启
或者主机上直接执行如下command
curl -X PUT "localhost:9200/twitter/_settings?pretty" -H 'Content-Type: application/json' -d'
{
"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}'
扩展
6.4版本的 官方文档:https://www.elastic.co/guide/en/elasticsearch/reference/6.4/disk-allocator.html
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"
}
}
'
以上是关于Elasticsearch - cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]的主要内容,如果未能解决你的问题,请参考以下文章
Elasticsearch 学习笔记 Elasticsearch及Elasticsearch head安装配置