报错内容:Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
解决问题:
1.查看对应索引内是否被修改为只读状态。
2.选择对应索引将只读状态设为空值。
PUT /your_index/_settings
{
"index.blocks.read_only_allow_delete": null
}
3.如果想将所有的索引都取消只读,可以运行一下脚本。
PUT /_all/_settings
{
"index.blocks.read_only_allow_delete": null
}
运行结果:
// Cost: 191ms Size: 26B
{
"acknowledged": true
}