elasticsearch安装访问不了虚拟机中的elasticsearch 启动报错

1.宿主机访问不了虚拟机

一开始以为是防火墙问题,就添加端口

firewall-cmd --permanent --add-port=9200/tcp --zone=public

添加后发现还是不行,修改config下的elasticsearch.yml文件

修改 network.host: 192.168.98.128
ip为本机ip

2.重新启动还是报错,查看日志

ERROR: bootstrap checks failed

max file descriptors [10240]forelasticsearch process likely too low, increase to at least [65536]

max number of threads [1024]foruser [elsearch] likely too low, increase to at least [2048]

maxvirtualmemory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

google了下,修改虚拟机配置
1)vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

2)vi /etc/sysctl.conf

添加

vm.max_map_count=655360

并执行命令:

sysctl-p

再次启动就ok了

你可能感兴趣的:(elasticsearch安装访问不了虚拟机中的elasticsearch 启动报错)