启动报错
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
原因:elasticsearch用户拥有的可创建文件描述的权限太低,至少需要65536
解决办法:切换到root用户或者sudo执行vim /etc/security/limits.conf
文件末尾追加如下内容:
*** hard nofile 65536
*** soft nofile 65536
*** hard nproc 4096
*** soft nproc 4096
--*** 为启动Elasticsearch的用户名
--nofile表示最大文件句柄数,表示能够打开的最大文件数目
--nproc:用户可用的最大进程数量
--nofile:用户可打开的最大文件总数
验证:ulimit -Hn
如果立马执行显示结果不为65536,关闭连接后重新连接服务器,执行验证即可。
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
原因:elasticsearch用户拥有的内存权限太小,至少需要262144
解决办法:切换到root用户或者sudo执行sysctl -w vm.max_map_count=262144
验证:sysctl -a|grep vm.max_map_count
若失效,在/etc/sysctl.conf
文件末尾追加一行
扫描二维码关注公众号,回复:
10822675 查看本文章
vm.max_map_count=262144
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
解决办法:vim config/elasticsearch.yml
取消相关注释保留一个节点即可