Caused by: com.github.vanroy.springdata.jest.exception.JestElasticsearchException: Cannot execute jest action , response code : 403 , error : {"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"} , message : null
at com.github.vanroy.springdata.jest.mapper.DefaultErrorMapper.mapError(DefaultErrorMapper.java:30)
at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.execute(JestElasticsearchTemplate.java:1211)
at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.executeWithAcknowledge(JestElasticsearchTemplate.java:1220)
at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.putMapping(JestElasticsearchTemplate.java:232)
... 70 common frames omitted
错误日志如上,导致报错的原因是 索引变为只读,因为磁盘上没有更多空间。如果您使用了 95% 的磁盘空间。es 服务器将每 30 秒将所有索引变为只读模式。如果没有剩余空间,则需要释放足够的空间或按照指南所述更改 es 配置。
解决思路
1.清理或者扩展磁盘空间
2.es服务器执行
curl -X PUT "localhost:9200/_all/_settings" -H 'Content-Type: application/json' -d '{"index.blocks.read_only_allow_delete": null}'