Elasticsearch安装过程问题总结(一)

注:以下内容基于CentOS Linux release 7.5.1804,elasticsearch 6.5.4

1.org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

原因:不能用root账户启动
解决方法:创建普通用户,并授权es整个文件夹的执行权限给创建的用户,使用创建的用户启动。


2.java.nio.file.AccessDeniedException: /data/wwwroot/elasticsearch-x.x.x/config/jvm.options

原因:当前用户没有执行权限
解决方法:授权es整个文件夹的执行权限给启动的用户。


3.max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因:一个进程可以拥有的VMA(虚拟内存区域)的数量太小
解决方法:执行sysctl -w vm.max_map_count=262144,如果没有权限,使用root账户执行。


4.max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

原因:最大文件描述符(max file descriptors)过小
解决办法:vim /etc/security/limits.conf,添加如下内容:

elasticsearcch          soft    nofile          65536
elasticsearcch          hard    nofile          131072

注意:1.修改后需要重新登录。
           2.第一列为用户名,尽量不要使用*,不然多用户使用,有没有断开的,容易造成重新登录不刷新ulimit值,修改不起作用。修改后可以用以下命令检查:

ulimit -Hn
ulimit -Sn

5.max number of threads [2048] for user [elasticsearch] is too low, increase to at least [4096]

原因:elasticsearch用户的最大线程数太低
解决办法:vim /etc/security/limits.conf,添加如下内容:

elasticsearcch          soft    nproc           4096
elasticsearcch           hard    nproc           4096

注意:登录用户断开重连。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值