Elasticsearch6.2 允许远程访问及常见错误

允许远程访问

vi conf/elasticsearch.yml

修改 network.host 为 0.0.0.0

network.host: 0.0.0.0

修改 discovery.zen.ping.unicast.hosts 为 [“0.0.0.0”]

discovery.zen.ping.unicast.hosts: ["0.0.0.0"]

重启后报错

ERROR: [1] bootstrap checks failed
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

解决方法

  1. vi /etc/sysctl.conf

设置fs.file-max=655350

保存之后sysctl -p使设置生效

  1. vi /etc/security/limits.conf 新增
* soft nofile 655350

* hard nofile 655350
  1. 重新登录服务器,再次启动即可。

然后不出意外应该可以远程访问了。

es1.png