Es批量插入数据报异常Unable to parse response body

java 复制代码
org.elasticsearch.ElasticsearchStatusException: Unable to parse response body
        at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2033)
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1777)
        at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1734)
        at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1696)
        at org.elasticsearch.client.RestHighLevelClient.bulk(RestHighLevelClient.java:472)
        at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.bulkIndex(ElasticsearchRestTemplate.java:766)
        at org.springframework.data.elasticsearch.core.ElasticsearchOperations.bulkIndex(ElasticsearchOperations.java:474)
        at org.zsdy.ext.admin.controller.EsQueryDataList.synchroniseDataAll(EsQueryDataList.java:111)
        at org.zsdy.ext.admin.controller.EsQueryDataList$$FastClassBySpringCGLIB$$452e2dd2.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
        at org.springframework.cloud.sleuth.instrument.async.TraceAsyncAspect.traceBackgroundThread(TraceAsyncAspect.java:67)
        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.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
        at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.springframework.cloud.sleuth.instrument.async.TraceRunnable.run(TraceRunnable.java:67)
        at org.springframework.cloud.sleuth.instrument.async.TraceRunnable.run(TraceRunnable.java:67)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        Suppressed: java.lang.IllegalStateException: Elasticsearch didn't return the [Content-Type] header, unable to parse response body
                at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2046)
                at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2030)
                ... 33 common frames omitted
Caused by: org.elasticsearch.client.ResponseException: method [POST], host [http://xx.xxx.xxx.xx:9201], URI [/_bulk?timeout=1m], status line [HTTP/1.1 413 Request Entity Too Large]

        at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:936)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:233)
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1764)
        ... 32 common frames omitted
Caused by: org.elasticsearch.client.ResponseException: method [POST], host [http://xx.xxx.xxx.xx:9201], URI [/_bulk?timeout=1m], status line [HTTP/1.1 413 Request Entity Too Large]

        at org.elasticsearch.client.RestClient$1.completed(RestClient.java:552)
        at org.elasticsearch.client.RestClient$1.completed(RestClient.java:537)
        at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:122)
        at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:181)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:448)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:338)
        at org.apache.http.impl.nio.client.InternalRequestExecutor.inputReady(InternalRequestExecutor.java:83)
        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
        ... 1 common frames omitted

Unable to parse response body

org.elasticsearch.client.ResponseException: method POST, host http://xx.xxx.xxx.xx:9201, URI /_bulk?timeout=1m, status line HTTP/1.1 413 Request Entity Too Large

因为批量提交提交内容请求实体太大超过了es中设置的最大值,Bulk 默认设置批量提交的数据量不能超过 100M

官网说明:

1、建议降低请求体的大小;

2、修改http.max_content_length的大小,不建议修改;

参考官网http请求的信息:Networking | Elasticsearch Guide 7.16 | Elastic

相关推荐
禾高网络29 分钟前
养老系统开发:背景、架构与养老行业展望
java·大数据·人工智能·小程序·架构
onthe_wing1 小时前
flink基础知识,系统运行时架构,部署模式详解
大数据·架构·flink
天辛大师2 小时前
天心大师谈重新学会传统文化,AI时代的心经奥义
大数据·人工智能·随机森林·重构·启发式算法
大模型码小白2 小时前
数据可视化:AI处理多维数据的HTML5可视化方案
大数据·前端·javascript·人工智能·机器学习·信息可视化·html5
cxk18082722 小时前
2026 年9月 AI 营销机构选型方法论:基于 GEO 精采信模式的三维评估体系
大数据·人工智能·科技·ai·geo·昆明geo
Elastic 中国社区官方博客2 小时前
不再有分配延迟:在无状态 Elasticsearch 中将快照与分片迁移解耦
大数据·运维·人工智能·elasticsearch·搜索引擎·全文检索
Python 实战手记3 小时前
2026 企业微信主体变更公证办理指南:场景条件、材料清单、线上实操流程
大数据·人工智能·企业微信
用户3610588626123 小时前
SparkStreaming 之配置参数详解
大数据·spark
幂律智能3 小时前
穿透到合同,管控到付款
大数据·人工智能
PcVue China4 小时前
智控能耗,数驱能效 | PcVue线上研讨会进行中!
大数据·人工智能·能源·制造·直播·scada·pcvue17