一、
错误提示: 索引只读
2020-09-03 16:56:53.270 ERROR 7 --- [io-8080-exec-10] c.s.c.exception.ServiceExceptionHandler : Controller处理发生错误: IllegalArgumentException:Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177) ~[elasticsearch-7.1.0.jar!/:7.1.0]
处理方法: 把只读属性去掉
# 下面的IP和对应端口⚠️替换
curl -s -H 'Content-Type: application/json' -XPUT '10.200.22.39:30004/_all/_settings?pretty' -d ' {
"index":{
"blocks" : {"read_only_allow_delete":"false"}
}
}'