ElasticSearch错误:DataAccessResourceFailureException:30,000毫秒连接超时http-out-0[active];

sr4lhrrt  于 2022-10-06  发布在  ElasticSearch
关注(0)|答案(1)|浏览(281)

Org.springframework.dao.DataAccessResourceFailureException:连接超时30,000毫秒-传出-0[活动];嵌套异常为java.lang。运行异常:连接超时30,000毫秒http-传出-0[活动]原因:java.lang.运行异常:连接超时30,000毫秒org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:425)-传出-0[活动]...108更多原因:java.net.SocketTimeout异常:连接超时30,000毫秒-传出-0[活动]

pod7payv

pod7payv1#

您的配置正在使用默认超时。按如下方式配置RestClient:

return 
  new RestHighLevelClient(
      RestClient.builder(
        HttpHost.create(__elasticEndpointUrl__))
          .setHttpClientConfigCallback( hacb -> hacb.addInterceptorLast(__interceptorHere__))
          .setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(__timeOutHere__)
          .setSocketTimeout(__**putHighValueHere**__)));

相关问题