问题:
elasticsearch每次都批量插入几万数据量,然后就会出现下列问题。看这个问题应该是配置的问题
ERROR [https-jsse-nio-443-exec-4] 2020-07-09 23:31:54 (EsMiniDaansouDataInfoWithBLOBsUtil.java:80) java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection http-outgoing-0 [ACTIVE]
at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:808)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:248)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1611)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1581)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1551)
at org.elasticsearch.client.RestHighLevelClient.bulk(RestHighLevelClient.java:531)
at cn.dxszxw.elasticsearch.esUtils.EsMiniDaansouDataInfoWithBLOBsUtil.increaseEsData(EsMiniDaansouDataInfoWithBLOBsUtil.java:76)
at cn.dxszxw.controller.ElasticsearchController.createMiniDaansouDataInfoWithBLOBsAllIndexByRange(ElasticsearchController.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMeth

在Elasticsearch中批量插入大量数据时遇到30秒超时问题,通过调整RestHighLevelClient的连接和套接字超时设置,成功解决超时问题,确保了大数据量的顺利插入。
8011

被折叠的 条评论
为什么被折叠?



