前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Elasticsearch " Request cannot be executed; I/O reactor status:",如何处理?

Elasticsearch " Request cannot be executed; I/O reactor status:",如何处理?

原创
作者头像
南非骆驼说大数据
修改2021-03-26 17:44:07
17.7K3
修改2021-03-26 17:44:07
举报

一、前言|

近来,客户在使用JAVA 客户端操作ES集群的时候,出现 "Request cannot be executed; I/O reactor status: STOPPED

"错误,如何解决呢?我们来看看这个问题:

二、故障现象

报错截图1
报错截图1
报错截图2
报错截图2
ParameterizedMessage[messagePattern=elasticSearch error->{}, stringArgs=[Request cannot be executed; I/O reactor status: STOPPED, com.weimob.saas.ec.goods.elasticsearch.monitor.ElasticSearchException: Request cannot be executed; I/O reactor status: STOPPED], throwable=com.weimob.saas.ec.goods.elasticsearch.monitor.ElasticSearchException: Request cannot be executed; I/O reactor status: STOPPED] com.weimob.saas.ec.goods.elasticsearch.monitor.ElasticSearchException: Request cannot be executed; I/O reactor status: STOPPED
at com.weimob.saas.ec.goods.elasticsearch.ElasticSearch7ApiImpl.doExecute(ElasticSearch7ApiImpl.java:130)
at com.weimob.saas.ec.goods.elasticsearch.ElasticSearch7ApiImpl.search(ElasticSearch7ApiImpl.java:64)
at com.weimob.saas.ec.goods.elasticsearch.ElasticSearch7ApiImpl$$FastClassBySpringCGLIB$$a581fc99.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:84)
at com.weimob.saas.ec.goods.elasticsearch.monitor.MonitorAspect.doAround(MonitorAspect.java:29)
at sun.reflect.GeneratedMethodAccessor1126.invoke(Unknown Source)
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:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at com.weimob.saas.ec.goods.elasticsearch.ElasticSearch7ApiImpl$$EnhancerBySpringCGLIB$$241fe093.search(<generated>)
at com.weimob.saas.ec.goods.service.elasticsearch.impl.EsSearchServiceImpl.queryGoodsListWithOrderByPage(EsSearchServiceImpl.java:122)
at com.weimob.saas.ec.goods.service.elasticsearch.impl.EsSearchServiceImpl$$FastClassBySpringCGLIB$$142346b1.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

问题分析: 看起来是客户端的报错,提示连接重置了。

三、解决办法

这个异常通常有下面几个原因导致:

1、客户端文件句柄耗尽

2、并发连接es的客户端太多

3、客户端连接es后长时间没有数据读写又没有及时close然后下次有数据读写又复用同一个连接

4、es负载太高

客户可以排查下业务客户端是哪种原因造成。

其次,经过上面的排查,也可这样去进行操作:

这个预计是ES Rest Client的Bug,在社区里有几个非常高频的ISSUE,目前最新版本尚未解决。

基本原因:client内部的调用链为IOReactor->performRequestAsync的Listener -> onFailure,当短暂抖动触发onFailure中抛出异常时,最终导致整个IOReactor不可用,后续请求都受影响,也就是我们看到的需要重启才能恢复。

解决方案

1. 发生错误时,重建client进行查询重试;

2. 直接使用各类常用http库给es发送请求。

3. 重启观察看下,暂时建议在代码中判断类似出错后,重新建立client

参考如下社区的链接参考:

https://github.com/elastic/elasticsearch/issues/45115

https://github.com/elastic/elasticsearch/issues/39946

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、前言|
  • 二、故障现象
  • 三、解决办法
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档