一、外网访问问题
默认情况下,是不支持外网访问,如果你的Elasticsearch安装在其他机器上,你从外网去访问的时候,访问不到,不通。
那么需要修改配置。
进入文件夹:
elasticsearch-7.0.0/config$
修改:elasticsearch.yml文件
添加
network.host: 0.0.0.0
二、会报错
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: 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
三、解决方案
1.针对问题1
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
使用sudo用户修改文件:sudo vim /etc/sysctl.conf
添加一行配置:
vm.max_map_count=655360
查看是否生效:
sudo sysctl -p
2.针对问题2
[2]: 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
放开:
cluster.initial_master_nodes: ["node-1", "node-2"]
然后就启动elasticsearch,就可以通过外网访问了。
本文由 guoxiaorui 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Aug 29, 2020 at 12:15 pm