第三个问题的解决办法查了很久,最终解决了,用root用户修改配置,用其他用户启动elasticsearch
[1]: max number of threads [1024] for user [leyou] is too low, increase to at least [4096]
这是线程数不够。
vim /etc/security/limits.d/20-nproc.conf(7是0-nproc.conf,6是90-nproc.conf)
修改内容:* soft nproc 1024改为:* soft nproc 4096
[2]: max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
然后修改配置文件:
vim /etc/security/limits.conf
添加下面的内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 4096
* hard nproc 4096
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
vm.max_map_count:限制一个进程可以拥有的VMA(虚拟内存区域)的数量
解决:
1、修改max_map_count值
$ sudo sysctl -w vm.max_map_count=262144(用root用户修改不用输密码,哈哈)
2、查看是否修改为262144
$ more /proc/sys/vm/max_map_count
262144
3、重新启动ElasticSearch