elasticsearch7.4.0启动报错:
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [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
解决操作
以下操作需切换到root用户下
$ sudo -s
问题[1]
查看软硬限制命令
# ulimit -Su
# ulimit -Hu
在文件 /etc/security/limits.conf
末尾添加以下内容(* 表示所有用户)
* soft nofile 65536
* hard nofile 131072
如果还报错max number of threads [3818] for user [es] is too low, increase to at least [4096]
则需要在 /etc/security/limits.conf
末尾 追加
* soft nproc 2048
* hard nproc 4096
以上配置需要用户重新登陆后生效
问题[2]
临时修改解决办法(重启系统失效):
# sysctl -w vm.max_map_count=262144
查看结果:
# sysctl -a|grep vm.max_map_count
显示:vm.max_map_count = 262144
永久修改解决办法:
在 /etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144
生效查看:
# sysctl -p
问题[3]
修改 config/elasticsearch.yml 保留一个节点
cluster.initial_master_nodes: ["node-1"]
其它问题
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
在 config/elasticsearch.yml中修改或添加配置项:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false