本文主要是介绍Elasticsearch 6.x升级7.x 版本Scroll,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Trying to create too many scroll contexts. Must be less than or equal to: [500]
异常的描述是scroll快照太多,同时存在的context数量超过500导致异常
kibana命令清除
DELETE _search/scroll/_all
JAVA逻辑清除
private RestHighLevelClient client;
private String scrollId;
public RestHighLevelClient getClient() {return client;}public void setClient(RestHighLevelClient client) {this.client = client;}public String getScrollId() {return scrollId;}public void setScrollId(String scrollId) {this.scrollId = scrollId;}public void cleanScroll() throws IOException {ClearScrollRequest clearScrollRequest = new ClearScrollRequest();clearScrollRequest.addScrollId(this.scrollId);ClearScrollResponse clearScrollResponse = this.client.clearScroll(clearScrollRequest,RequestOptions.DEFAULT);if (!clearScrollResponse.isSucceeded()){log.info(clearScrollResponse.toString());}else{log.info("============清除过期游标成功=========");}}
这篇关于Elasticsearch 6.x升级7.x 版本Scroll的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!