1 日志提示: UseConcMarkSweepGC was deprecated
- 具体日志如下:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
- 解决办法: 修改jvm.options
-XX:+UseConcMarkSweepGC 改为 -XX:+UseG1GC
2 java.security.AccessControlException
- 集群日志如下:
[2021-10-21T14:03:34,533][ERROR][o.a.l.DicLibrary ] [aid-cluster-node-20] Init dic library error :java.security.AccessControlException: access denied ("java.io.FilePermission" "dic" "read"), path: dic
- 解决办法:修改 java.policy 文件
打开文件
vi /data/900x/elasticsearch/jdk/conf/security/java.policy
找到 gant ,在最后增加语句:
permission java.io.FilePermission "*", "read,write";
[2021-10-21T15:19:44,409][ERROR][o.a.l.DicLibrary ] [aid-cluster-node-01] Init dic library error :
org.ansj.exception.LibraryException: path :dic file:/data/900x/elasticsearch/dic not found or can not to read, path:
dic
Init dic library error :org.ansj.exception.LibraryException: path :dic file:/data/900x/elasticsearch/dic not found or
can not to read, path: dic
3 java 代码调用 ES 报错: Data Too Large
Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large, data for [] would be [27568521612/25.6gb], which is larger than the limit of [27487790694/25.5gb], real usage: [27568521280/25.6gb], new bytes reserved: [332/332b], usages [request=0/0b, fielddata=0/0b, in_flight_requests=332/332b, accounting=16612791/15.8mb]]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-94mC8w4w-1665671536336)(00_images/00_image_datatoolarge.png)]
DataTooLarge
- 报错原因
ES 内存缓存数据 + 当前查询需要的缓存数据量 达到了 断路器
。
- 解决办法
在 ES 配置文件 elasticsearch.yml
中加入如下参数 indices.fielddata.cache.size
, 参数的大小与 indices.breaker.fielddata.limit
保持一致;
indices.fielddata.cache.size: 60%
4 调用 ES 报错: reactor I/O status STOPPED: 为真正解决
- 报错日志如下:
Request cannot be executed; I/O reactor status: STOPPED
reactor I/O status: STOPPED
-
报错原因
- 多线程状态下,某个线程关闭了 RestHighLevelClient (此说法可能性不大)
- 连接超时,索引数据太大,有相关聚合统计,导致 ES 处理时间过长
- ES 自带 bug
-
解决办法
-
重启 ES 节点即可解决问题;