[超级重点] ElasticSearch 6.1.1 centos 7 启动 实战 南摩阿彌陀佛 - Powered by Discuz!

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

[root@izwz93p6s96mh2av2ty5khz bin]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 63469
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 65535
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

elasticsearch6.1.1启动失败,出现如下提示:

1、Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)

由于elasticsearch5.0默认分配jvm空间大小为2g,修改jvm空间分配
# vim config/jvm.options  
-Xms2g  
-Xmx2g  
修改为  
-Xms512m  
-Xmx512m

如果内存不足,就不要玩了2g以上

2、max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
修改 /etc/security/limits.d/90-nproc.conf

*          soft    nproc     1024
*          soft    nproc     2048

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

修改/etc/sysctl.conf配置文件,

cat /etc/sysctl.conf | grep vm.max_map_count
vm.max_map_count=262144

如果不存在则添加

echo "vm.max_map_count=262144" >>/etc/sysctl.conf

生效
sudo sysctl -p  

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

ulimit -n 65536
第四项 4、max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
这个的问题解决方式应该是
vim /etc/security/limits.conf
在末尾追加以下内容(elk为启动用户,当然也可以指定为*)
elk soft nofile 65536
elk hard nofile 65536

以下是在6.1.1是踩过的坑

5、启动异常:ERROR: bootstrap checks failed

system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

问题原因:因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。详见 :https://github.com/elastic/elasticsearch/issues/22899

解决方法:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

6、logstash使用rpm包安装的时候没有配置init的启动脚本

默认情况使用rpm包安装完logstash之后没有启动脚本。官网给了一个脚本,需要根据不同的系统版本生成对应的启动脚本,而且官网没有给明使用方法,对于新用户来说算是个坑,不过在终端可以查看到脚本的使用帮助#
/usr/share/logstash/bin/system-install --help

生成启动脚本,centos6使用sysv参数,centos7使用systemd

# /usr/share/logstash/bin/system-install
/etc/logstash/startup.options
sysv

Successfully
created system
startup
script for
Logstash


请先后发表评论
  • 最新评论
  • 总共0条评论