以下问题都是作者亲身踩过的坑,希望对小伙伴有帮助^_^
问题一:
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方法:
1.max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
vi /etc/security/limits.conf
#es 是用户名
es hard nofile 65536
es soft nofile 65536
#重新登录 yellowcong 账户,查看是否生效
su yellowcong
#查看配置是否生效
ulimit -Hn
2.max virtual memory areas vm.max......
#修改sysctl配置
vi /etc/sysctl.conf
#添加如下配置
vm.max_map_count=262144
#让配置生效
sysctl -p
#查看配置的数目
sysctl -a|grep vm.max_map_count
如果仍然不生效,重启
问题二:
JNA Warning: IOException removing temporary files: JNA temporary directory '/home/yutao/tmp/elasticsearch' is not writable
[2017-12-02T17:54:50,683][WARN ][o.e.b.Natives ] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/linux-x86-64/libjnidispatch.so library:
JNA temporary directory '/home/yutao/tmp/elasticsearch' is not writable
解决方法:
vim jvm.options
# 上面省略。。。
# 在最后添加
-Djava.io.tmpdir=/home/yutao/tmp/elasticsearch
-Djna.tmpdir=/home/yutao/tmp/elasticsearch
问题三:
聚合的时候会有问题 nested: CircuitBreakingException[[request] Data too large, data for [<agg [data_result]>] would be [622780448/593.9mb],
which is larger than the limit of [622775500/593.9mb]]; }
解决方法:
在elasticsearch.yml中配置indices.fielddata.cache.size: 5GB ,调大fielddata的大小
问题四:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
原因: 因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动解决
解决方法:
修改elasticsearch.yml 添加一下内容 :
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
问题五:max number of threads [1024] for user [es] likely too low, increase to at least [4096]
解决方法:
切换到root用户,进入limits.d目录下修改配置文件。
vi /etc/security/limits.d/90-nproc.conf
修改如下内容:
* soft nproc 1024
#修改为
* soft nproc 4096
问题六:
failed to load elasticsearch nodes : org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
解决办法:
curl -XPUT -H "Content-Type: application/json" http://master:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
问题七:
java.lang.RuntimeException: can not run elasticsearch as root
解决方法:
ElasticSearch的保护机制,root启动权限太大,默认不让ElasticSearch使用root权限启动。可以切换到es的用户,然后启动即可。例如:
最后,欢迎热爱技术的小伙伴加入我们的聊天群qq:852278138