修改elasticsearch-6.1.1/config
目录下的elasticsearch.yml
文件中的network.host
值改为0.0.0.0
用root权限操作
错误1
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [3889] for user [elasticsearch] is too low, increase to at least [4096]
解决问题:
- 通过root用户登录服务器
vi /etc/security/limits.conf
- 在文件结尾添加如下内容,其中
elasticsearch
上面创建的用户,后面配置的数字就是上面报错信息对应的建议值。
elasticsearch soft nofile 65536
elasticsearch hard nofile 65536
elasticsearch soft nproc 4096
elasticsearch hard nproc 4096
错误2
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-04-26T09:09:49,533][INFO ][o.e.n.Node] [reyPF0X] stopping ...
[2018-04-26T09:09:49,571][INFO ][o.e.n.Node] [reyPF0X] stopped
[2018-04-26T09:09:49,571][INFO ][o.e.n.Node] [reyPF0X] closing ...
[2018-04-26T09:09:49,593][INFO ][o.e.n.Node] [reyPF0X] closed
解决:
vi /etc/sysctl.conf
2.添加下面配置:
vm.max_map_count=655360
3.执行命令:
sysctl -p
重启,
错误3
启动内存不足,(物理内存不足)
$./bin/elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /data/elasticsearch-5.2.2/hs_err_pid26945.log
解决方法(调小内存)
# vi ${elasticsearch_HOME}/config/jvm.options
#-Xms2g
#-Xmx2g
-Xms512m
-Xmx512m