elasticsearch的服务器响应异常及解决策略(转)
详述:
1 _riverStatus Import_fail
问题描述: 发现有个索引的数据同步不完整,在 http://192.168.1.17:9200/_plugin/head/ 在browse - river里看到 _riverStatus Import_fail
查看 elasticsearch 的log发现 有几条数据由于异常造成同步失败,处理好数据好重新建索引数据同步正常。
2 es_rejected_execution_exception <429>
此异常主要是因为请求数过多,es的线程池不够用了。
默认bulk thead pool set queue capacity =50 这个可以设置大点
打开 elasticsearch.yml 在末尾加上
threadpool:
bulk:
type: fixed
size: 60
queue_size: 1000
重新启动服务即可
另:
--查看线程池设置--
curl -XGET "http://localhost:9200/_nodes/thread_pool/"
非bulk入库thread pool设置可以这样修改
threadpool:
index:
type: fixed
size: 30
queue_size: 1000
关于该异常,有网友给的解释挺好的:
Elasticsearch has a thread pool and a queue for search per node. A thread pool will have N number of workers ready to handle the requests. When a request comes and if a worker is free , this is handled by the worker. Now by default the number of workers is equal to the number of cores on that CPU. When the workers are full and there are more search requests , the request will go to queue. The size of queue is also limited. Its by default size is say 100 and if there happens more parallel requests than this , then those requests would be rejected as you can see in the error log. The solution to this would be to - 1. Increase the size of queue or threadpool - The immediate solution for this would be to increase the size of the search queue. We can also increase the size of threadpool , but then that might badly effect the performance of individual queries. So increasing the queue might be a good idea. But then remember that this queue is memory residential and increasing the queue size too much can result in Out Of Memory issues. You can get more info on the same here.
2. Increase number of nodes and replicas - Remember each node has its own search threadpool/queue. Also search can happen on primary shard OR replica.
关于thread pool,可参看:https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html
3 create_failed_engine_exception <500>
相关分片损坏.
删除该分片重建即可。
4 mapper_parsing_exception <400>
存在字段格式不正确,与mapping不匹配。
检查文档字段格式,格式不正确有两种情况,其一是格式与mapping不匹配,其二是对字符串而言,可能字符非法。
5 index_not_found_exception <404>
索引不存在。
建立索引。
6 Result window is too large, from + size must be less than or equal to: [10000] but was [10000000].
result window的值默认为10000,比实际需求的小,故而报错。
两个方法:其一,在elasticsearch.yml中设置index.max_result_window,也可以直接修改某索引的settings:
curl -XPUT http://127.0.0.1:9200/indexname/_settings -d '{ "index" : { "max_result_window" : 100000000}}'
其二,使用scroll api。
POST /twitter/tweet/_search?scroll=1m
{
"size": 100,
"query": {
"match" : {
"title" : "elasticsearch"
}
}
}
从服务器响应获取scroll_id,然后后面批次的结果可通过循环使用下面语句得到:
POST /_search/scroll
{
"scroll" : "1m",
"scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="
}
关于scroll api,可参看:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
7 illegal_argument_exception: number of documents in the index cannot exceed 2147483519 <400>
分片上文档数达到20亿上限,无法插入新文档。
重建索引,增加分片;也可以增加节点。
8 action_request_validation_exception: Validation Failed:1:no requests added <400>
这个错误一般出现在bulk入库时,是格式不对,每行数据后面都得回车换行,最后一行后要跟空行。
修改格式就可以重新bulk了。
9 No Marvel Data Found (marvel error)
一般是人为删除(比如在sense插件里执行删除命令)marvel数据,导致marvel采集出错(删除了半天数据,另外半天数据将无法正常采集),不能统计;对于这种情况,等第二天marvel就可以正常使用了。
也有可能是9300端口被占用,marvel默认使用9300端口;对于这种情况,找到9300端口占用进程,kill掉,重启kibana即可。
10 Bad Request, you must reconsidered your request. <400>
一般是数据格式不对。
11 Invalid numeric value: Leading zeroes not allowed\n <400>
这种情况是整数类型字段格式不正确,比如一个整数等于0000。检查每个整数字段的数据生成即可。
12 #Deprecation: query malformed, empty clause found at [9:9]
查询语句不合法,里面含有空大括号。
13 query:string_index_out_of_bounds_exception
查询数据时,曾遇到这个问题。后来发现是http请求头格式不对,url里多了一个斜杠,却报了这个错误,特此记录。
14 failed to obtain node locks
在同一个节点(linux系统)上启动多个elasticsearch时出现failed to obtain node locks错误,启动失败.
转载自:https://www.cnblogs.com/jiu0821/p/6075833.html#_label0_7
elasticsearch的服务器响应异常及解决策略(转)的更多相关文章
- elasticsearch的服务器响应异常及应对策略
目录: 1 _riverStatus Import_fail 2 es_rejected_execution_exception <429> 3 create_failed_engine_ ...
- asp.net 发送电子邮件本地测试正常,但服务器上异常的解决办法
如题,这个问题曾经非常苦恼,代码肯定是没有问题的.在网上也查找了不少资料,按照他们的步骤做了,还是无效. 最后问题解决了,原来:我租用腾讯云服务器,腾讯为了防止垃圾邮件,禁止了邮件发送的25号端口,原 ...
- 发送邮件,出现异常:服务器响应为: Error: need EHLO and AUTH first !"
在使用 System.Net.Mail组建发送邮件的时候出现了"命令顺序不正确. 服务器响应为: Error: need EHLO and AUTH first !"异常 解决方法 ...
- 服务器响应慢的分析与解决(Linux服务器)
一.分析思路 1.排除本机自身原因 2.服务器性能分析 3.项目本身分析(不详细说) 4.虚拟机分析 5.数据库分析 二.详细分析方法 1.排除本机自身原因 可以使用站长工具测试网站速度. 2.服务器 ...
- C#发送邮件时提示:“不允许使用邮箱名称。服务器响应为:”的错误解决办法
由于项目需要,要为客户提供一个定期发送邮件的程序.本来原来自己还写过,但新写的程序一晚上也没通过测试,总是提示"不允许使用邮箱名称.服务器响应为..." 经过在网上搜索查找解决办法 ...
- Linux 下Tomcat服务器响应越来越慢分分析
本文转自自:https://www.cnblogs.com/yangc/p/6859985.html ,感谢给我提供提供思路. 服务器响应慢的分析与解决(Linux服务器) 一.分析思路 1.排除本机 ...
- SSH乱码和Xshell异常断开解决方法
一.SSH Secure Shell Client中文乱码的解决方法 这是SSH Secure Shell Client多年未解决的短板,要求客户端和服务器端都要‘UTF-8’编码,我终于知道Wind ...
- Windows Server 2008 网站访问PHP响应慢的解决方法
公司新上了一个网站,但是在配置完PHP环境之后却发现了问题,访问HTML速度飞快,而访问PHP网页时就要卡顿1秒,响应很慢的样子,排除了带宽的因素之后,在百度上搜了一圈竟然解决了,现在将方法转载给大家 ...
- org/apache/commons/pool/impl/GenericObjectPool异常的解决办法
org/apache/commons/pool/impl/GenericObjectPool异常的解决办法 webwork+spring+hibernate框架的集成, 一启动Tomcat服务器就出了 ...
随机推荐
- Thinkphp 图形验证码无法显示
不显示验证码的代码: public function verify(){ $verify = new \Think\Verify(); $verify->entry(); } 修改为: publ ...
- JavaScript 中的陷阱
JavaScript 通过函数管理作用域.在函数内部声明的变量只在这个函数内部,函数外面不可用.另一方面,全局变量就是在任何函数外面声明的或是未声明直接简单使用的. “未声明直接简单使用”,指的是不用 ...
- sencha touch 组件选择器getCmp和ComponentQuery.query()的效率解析
昨天无意中在网上看到一篇讲解sencha touch组件选择器的文章,名为 Sencha touch 2通过Ext.ComponentQuery.query查找组件. 里面对组件选择器的效率讲解完全反 ...
- Linux数据链路层的包解析
仅以此文作为学习笔记,初学者,如有错误欢迎批评指正,但求轻喷.一般而言,Linux系统截获数据包后,会通过协议栈,按照TCP/IP层次进行解析,那我们如何直接获得更为底层的数据报文呢,这里用到一个类型 ...
- squid 高匿设置
1.透明代理.匿名代理.混淆代理.高匿代理有什么区别 这4种代理,主要是在代理服务器端的配置不同,导致其向目标地址发送请求时,REMOTE_ADDR, HTTP_VIA,HTTP_X_FORWARDE ...
- mysql数据库LOAD DATA INFILE Syntax
1.LOAD DATA INFILE用来把一个文本文件里的内容高速写入到MySQL表里,它和SELECT ... INTO FILE的操作是对应的,一个导入.一个导出.使用LOAD DATA INFI ...
- thinkphp---自动验证的问题
这段时间做一个项目:使用 thinkphp 做了一个自动验证,但是发现如果新增的时候,是能够进行自动验证的,但是在修改的修改的时候,会发现自动验证会失效. 验证的时候,模型是这样写的: protect ...
- Sublime的使用!emmet常用快捷键梳理
多的不说了! 示例一: !+tab 效果: <!doctype html> <html lang="en"> <head> <meta c ...
- Spring 加载配置文件的方式
我们常用的加载context文件的方法有如下三个: 1.FileSystemXmlApplicationContext 这个方法是从文件绝对路径加载配置文件,例如: ApplicationContex ...
- hdu6386 Age of Moyu【最短路】
Age of Moyu Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) To ...