行动是治愈恐惧的良药,而犹豫、拖延将不断滋养恐惧。

es使用报错I/O reactor status: STOPPE

Elasticsearch | 作者 heheidiot | 发布于2021年08月02日 | 阅读数:2361

spring 4.3.22;
spring-data-elasticsearch3.1.3.RELEASE
elasticsearch-rest-high-level-client、elasticsearch-rest-client、elasticsearch均为6.2.2
调用代码:

SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
SearchRequest rq = new SearchRequest(); rq.indices("local_myindex"); sourceBuilder.query(QueryBuilders.matchAllQuery());
RestHighLevelClient clients = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost", 9200, "http"))); 
try { SearchResponse rp = clients.search(rq,new BasicHeader("contentType","application/json")); 
 报错:
java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED

at org.apache.http.util.Asserts.check(Asserts.java:40)
at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:112)
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:346)
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:328)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:221)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:194)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:488)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:474)
at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:391)
已邀请:

tongchuan1992 - 学无止境、学以致用

赞同来自:

你这个看着像创建clent都没成功吧,debug调试一下。

superman

赞同来自:

看看有没有代码里主动吧client关闭了

codersun

赞同来自:

这个好像是个官方的Bug,你需要升级下sdk

要回复问题请先登录注册