出现异常:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are neede
这是在因为Centos6不支持SecComp,而es默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
在elastisearch.yml中加入以下配置:
bootstrap.system_call_filter: false
出现异常:
max file de ors [4096] for elasticsearch process likely too low,increase to at least[65536]
/etc/security/limits.conf
编辑该文件,后面加上:
cjh soft nofile 65536
cjh hard nofile 65536
注意:cjh为登陆当前linux的用户名(不是root的用户)
出现异常:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
是操作系统的vm.max_map_count参数设置太小导致的,请使用root用户登录系统,执行以下命令:
sysctl -w vm.max_map_count=262144
并用以下命令查看是否修改成功
sysctl -a | grep \"vm.max_map_count\"
如果能正常输出655360,则说明修改成功,然后再次启动elasticsearch
或者:(永久性的)
解决办法:
1、切换到root用户修改配置sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p 即可
出现异常:
max number of threads [3810] for user [elk] is too low, increase to at least [4096]
修改(切换到root用户下)
vim /etc/security/limits.d/90-nproc.conf
改为 * soft nproc 4096 (注意仅仅是修改这个是不起作用的,还是会报错,要加入下面的一行才行)
同时添加:
* hard nproc 4096
JAVAClient的使用:
一、引入相关jar包,注意官方文档中少了要给jar包
<!-- 引入elasticsearch的客户端 -->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.2.4</version>
</dependency>
<!--引入核心es包-->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.2.4</version>
</dependency>
<!-- 加入日志 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
application.properties中加入:
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
rootLogger.level = info
rootLogger.appenderRef.console.ref = console
二、测试
// on startup
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new TransportAddress(InetAddress.getByName(\"192.168.1.10\"), 9300))
.addTransportAddress(new TransportAddress(InetAddress.getByName(\"192.168.1.11\"), 9300));
// on shutdown
client.close();92.168.1.11\"), 9300));
// on shutdown
client.close();
异常:
org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of org.elasticsearchxxxx
我这里的一个原因是对应的记录不存在。我改成存在的记录时,记录可以删除,但是还是会报出这个异常。
继续阅读与本文标签相同的文章
-
5G远程驾驶和微公交首秀互联网大会
2026-05-14栏目: 教程
-
学宏程序编程,这些知识必不可少!
2026-05-14栏目: 教程
-
华为准备卖出“落后”的5G,多家美企极力竞争!任正非格局太大!
2026-05-14栏目: 教程
-
百度:飞桨深度学习平台已累计服务150多万开发者
2026-05-14栏目: 教程
-
滴滴公布安全功能数据:近2亿用户添加紧急联系人
2026-05-14栏目: 教程
