ElasticSearch踩坑记录
一、分词错误
[2018-02-06 14:28:30:098] --- [INFO] --- [CjhArticleSimilarityTask.java:66] --- [【SimilarityConsumeTask】=报错结束,时间:2018-02-06 14:28:30,errorMsg:Failed to deserialize response of type [org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse]] ---
[2018-02-06 14:28:30:099] --- [ERROR] --- [LogUtils.java:59] --- [【SimilarityConsumeTask】=报错结束,时间:2018-02-06 14:28:30] ---
TransportSerializationException[Failed to deserialize response of type [org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse]]; nested: IllegalStateException[unexpected byte [0x43]];
at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:1425)
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1397)
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:74)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:544)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: unexpected byte [0x43]
at org.elasticsearch.common.io.stream.StreamInput.readBoolean(StreamInput.java:409)
at org.elasticsearch.common.io.stream.StreamInput.readBoolean(StreamInput.java:399)
at org.elasticsearch.common.io.stream.StreamInput.readOptionalString(StreamInput.java:315)
at org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse$AnalyzeToken.readFrom(AnalyzeResponse.java:128)
at org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse$AnalyzeToken.readAnalyzeToken(AnalyzeResponse.java:110)
at org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse.readFrom(AnalyzeResponse.java:201)
at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:1422)
... 27 more
解决:
生产环境ElasticSearch版本5.2.2,
期初es使用mvn版本 5.6.3,降低maven版本为5.2.2后搞定
二、es 5.2.2写入es报错:
Limit of total fields [1000] in index [my_index] has been exceeded
调整如下设置可以暂时解决:
PUT my_index/_settings { "index.mapping.total_fields.limit": 2000 }
报错的原因是json串写入es时解析字段类型错误,扩大了mapping,经测试逐个字段赋值是可以的,但是不方便。
同样的程序在es6.0下是不会出现该错误的。
三、es 5.2批量写入es报错:
[RemoteTransportException[[node_***][****:9300][indices:data/write/bulk[s]]]; nested: RemoteTransportException[[node_***.*][10.**.***.**:9300][indices:data/write/bulk[s][p]]]; nested: EsRejectedExecutionException[rejected execution of org.elasticsearch.transport.TransportService$7@5e2672b5 on EsThreadPoolExecutor[bulk, queue capacity = 50, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@151d7492[Running, pool size = 32, active threads = 32, queued tasks = 54, completed tasks = 814852676]]];] ---
put("es.batch.size.bytes", "300000000");
put("es.batch.size.entries", "500000");
put("es.input.json", "true");
put("es.batch.write.refresh", "false");
put("es.batch.write.retry.count","-1");
put("es.batch.write.retry.wait","300");
提交es频率太高,调整方案增大写入间隔和每次写入条数。
四、es日期字段自动识别为字符串
put test_date/test/1
{
"d1":"2017/11/04",
"d2":"2017-11-03 21:42:11",
"d3":"2017/11/03 21:42:11",
"d4":"2017-08-20T16:00:00.000Z"
}

五、解决报错 availableProcessors is already set to [16], rejecting [16]
@Configuration
public class ElasticSearchConfig {
/**
* 防止netty的bug
* java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
*/
@PostConstruct
void init() {
System.setProperty("es.set.netty.runtime.available.processors", "false");
}
}
ElasticSearch踩坑记录的更多相关文章
- centos 7( linux )下搭建elasticsearch踩坑记
原文:https://blog.csdn.net/an88411980/article/details/83150380 概述 公司最近在做全文检索的项目,发现elasticsearch踩了不少 ...
- unionId突然不能获取的踩坑记录
昨天(2016-2-2日),突然发现系统的一个微信接口使用不了了.后来经查发现,是在网页授权获取用户基本信息的时候,unionid获取失败导致的. 在网页授权获取用户基本信息的介绍中(http://m ...
- CentOS7.4安装MySQL踩坑记录
CentOS7.4安装MySQL踩坑记录 time: 2018.3.19 CentOS7.4安装MySQL时网上的文档虽然多但是不靠谱的也多, 可能因为版本与时间的问题, 所以记录下自己踩坑的过程, ...
- ubuntu 下安装docker 踩坑记录
ubuntu 下安装docker 踩坑记录 # Setp : 移除旧版本Docker sudo apt-get remove docker docker-engine docker.io # Step ...
- SpringBoot + Shiro + shiro.ini 的踩坑记录
0.写在前面的话 好久没写博客了,诶,好多时候偷懒直接就抓网上的资料丢笔记里了,也就没有自己提炼,偷懒偷懒.然后最近参加了一个网络课程,要交作业的那种,为了能方便看下其他同学的作业,就写了个爬虫把作业 ...
- 你真的了解字典(Dictionary)吗? C# Memory Cache 踩坑记录 .net 泛型 结构化CSS设计思维 WinForm POST上传与后台接收 高效实用的.NET开源项目 .net 笔试面试总结(3) .net 笔试面试总结(2) 依赖注入 C# RSA 加密 C#与Java AES 加密解密
你真的了解字典(Dictionary)吗? 从一道亲身经历的面试题说起 半年前,我参加我现在所在公司的面试,面试官给了一道题,说有一个Y形的链表,知道起始节点,找出交叉节点.为了便于描述,我把上面 ...
- google nmt 实验踩坑记录
最近因为要做一个title压缩的任务,所以调研了一些text summary的方法. text summary 一般分为抽取式和生成式两种.前者一般是从原始的文本中抽取出重要的word o ...
- ABP框架踩坑记录
ABP框架踩坑记录 ASP.NET Boilerplate是一个专用于现代Web应用程序的通用应用程序框架. 它使用了你已经熟悉的工具,并根据它们实现最佳实践. 文章目录 使用MySQL 配置User ...
- SpringBoot+SpringSecurity+Thymeleaf认证失败返回错误信息踩坑记录
Spring boot +Spring Security + Thymeleaf认证失败返回错误信息踩坑记录 步入8102年,现在企业开发追求快速,Springboot以多种优秀特性引领潮流,在众多使 ...
随机推荐
- 解析搜狗实验室精简版数据:1、批量将.txt编码格式转化为utf8 2、解析提取数据
在搜狗实验室里下载了精简版的数据,解压后是一个文件,里面有很多个.txt文档,里面编码格式都是ASCII.现需要将这些编码格式转化为utf-8,以下是python3语言编写的脚本,一般只需改变path ...
- Java内存区域与内存溢出异常(JVM学习系列1)
相对于C.C++等语言来说,Java语言一个很美好的特性就是自动内存管理机制.C语言等在申请堆内存时,需要malloc内存,用完还有手动进行free操作,若程序员忘记回收内存,那这块内存就只能在进程退 ...
- centos安装mariadb
一 配置mariadb官方的yum源 1.进入yum仓库 /etc/yum.repos.d/目录下 手动创建一个 mariadb.repo 写入如下内容 [mariadb] name = Maria ...
- java面向对象总结(二)
Java 封装 实现Java封装的步骤 java面向对象值继承 概念: 继承的格式: 类和类之间的关系: 继承的特点: 继承的优缺点 继承的好处: 继承的缺点: 继承的注意事项: 使用继承的步骤: J ...
- linux查看与修改交换内存配置(解决zabbix-agent启动报错)
问题 zabbix-agent在一台centos6.5上启动报错: cannot allocate shared memory of size 949056: [28] No space left o ...
- 14: InfluxDB+Grafana打造大数据监控利器
参考博客: https://www.cnblogs.com/davidwang456/p/7795263.html
- bzoj 1283 序列 - 费用流
题目传送门 传送门 题目大意 给定一个长度为$n$的序列,要求选出一些数使得原序列中每$m$个连续的数中不超过$K$个被选走.问最大的可能的和. 感觉建图好妙啊.. 考虑把问题转化成选$m$次数,每次 ...
- Java基础学习-标识符
1.标识符的作用 -给包.类.方法.变量等起名字 2.组成规则 -这里的字符采用的是Unicode字符集,所以包括英文大小写字母,中文字符,数字字符等.不建议使用汉字. -下划 ...
- jQuary学习の四の遍历
向上遍历DOM树: parent():返回被选元素的直接父元素 parents():返回被选元素的所有祖先元素(当后边参数存在时则表示其中与参数相同的祖先元素) parentsUntil()返回介于两 ...
- oracle to_char 格式大全
Postgres 格式化函数提供一套有效的工具用于把各种数据类型(日期/时间,int,float,numeric)转换成格式化的字符串以及反过来从格式化的字符串转换成原始的数据类型. 注意:所有格式化 ...